开发者

why an oracle procedure is invalid

Can someone please explain to me why I keep getting this PLS-00905 error for the below simple procedure? Thank you.

create or replace procedure copy_table(
    table_name IN varchar2, 
    database_link IN varchar2, 
    suffix IN varchar2, 
    table_owner IN varchar2)
IS
begin
    execute immediate 'create table ' || table_name || '_' || suffix || 
    ' as select * from ' || table_owner || '.' || table_name || '@' || database_link ;
end;
/


SQL> execute myschema.copy_table;
BEGIN myschem开发者_如何学运维a.copy_table; END;
              *
ERROR at line 1:
ORA-06550: line 1, column 15:
PLS-00905: object myschema.copy_table is invalid
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored


Get rid of the trailing slash - that's for SQLPlus command termination

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜