当前位置: 代码迷 >> Oracle管理 >> Insert into 在存储过程中的有关问题,不可以用order by
  详细解决方案

Insert into 在存储过程中的有关问题,不可以用order by

热度:60   发布时间:2016-04-24 06:03:50.0
Insert into 在存储过程中的问题,不可以用order by ?
create   or   replace   procedure   t     is
begin
insert   into   a  
select   *   from   b     ;  
end   t;

上面的可以编译,下面的就不可以编译?报   PLS-00103   错,为何?


create   or   replace   procedure   t     is
begin
insert   into   a  
select   *   from   b         order   by   col1   ;
end   t;

------解决方案--------------------
无意义的order by,

你后来的查询中用select * from a order by col1就可以了


------解决方案--------------------

是不是缺了个 "; "insert into a ;
------解决方案--------------------
表a和表b的表结构是否一样?检查一下
  相关解决方案