大家救救我吧,我的存储过程出现了个奇怪的编译错误create or replace procedure SaveStock2 as
begin insert into tf_test select * from(select tf2.*,row_number()over(partition by stock_id order by cjdate desc) rn from tf2 ) where rn<=1 commit;
exception
when others then
rollback;
dbms_output.put_line(SQLERRM);end;在执行下面这段的时候出现Compilation errors for PROCEDURE IPTV.SAVESTOCK2Error: PLS-00103: 出现符号 "("在需要下列之一时:
,from
Line: 5
Text: insert into tf_test select * from(select tf2.*,row_number()over(partition by stock_id order by cjdate desc) rn from tf2 ) where rn<=1
begin insert into tf_test select * from(select tf2.*,row_number()over(partition by stock_id order by cjdate desc) rn from tf2 ) where rn<=1 commit;
exception
when others then
rollback;
dbms_output.put_line(SQLERRM);end;在执行下面这段的时候出现Compilation errors for PROCEDURE IPTV.SAVESTOCK2Error: PLS-00103: 出现符号 "("在需要下列之一时:
,from
Line: 5
Text: insert into tf_test select * from(select tf2.*,row_number()over(partition by stock_id order by cjdate desc) rn from tf2 ) where rn<=1
str_sql varchar2(500);
begin str_sql:=' insert into tf_test select * from(select tf2.*,row_number()over(partition by stock_id order by cjdate desc) rn from tf2 ) where rn <=1';
execute immediate str_sql;
commit;
exception
when others then
rollback;
dbms_output.put_line(SQLERRM); end;
但是还是会出现编译的错误