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;

解决方案 »

  1.   

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

  2.   

    确实无意义。
    但是为何在存储过程中编译报错。单独执行确可以
    insert into a 
    select * from b    order by col1 ;
      

  3.   


    是不是缺了个";"insert into a ;
      

  4.   

    表a和表b的表结构是否一样
    因为在sqlplus里面执行是可以的:
    insert into a 
    select * from b    order by col1 ;
      

  5.   

    子查询里不可以用order by的
      

  6.   


    为何单独执行却可以
    insert into a 
    select * from b    order by col1 ;