首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > oracle >

oracle 的异常

2012-01-19 
oracle 的错误beginselect b.created from tfile b join(select t.fileidfrom tfile twhere t.mastertaski

oracle 的错误
begin
   
   
 select b.created from tfile b join 
  (select t.fileid from tfile t 
  where t.mastertaskid = '2281817d19bca7b20119d6bb4acb0d99' 
  order by t.created desc) a on 
  rownum=1 and b.fileid=a.fileid;
   
   
end ;
这个是需要运行的东西!我是在PLSQL Developer里面看的
如果我单独的运行sql语句的有结果的!
而且结果只有一个
可是我加上了begin 以后就出现:此select 缺少into子句
不知道为什么!  
   
 

[解决办法]
PL/SQL 块里的select 要用into赋值给变量
[解决办法]
先创建存储过程,再使用。
[解决办法]
begin end
块中间的语句是不能用select语句直接返回值的。
但可以把值储存到表或变量里。
[解决办法]
因为加了begin end 就是pl/sql程序了。。
在里面select 就要有into存放查询结果

热点排行