我需要编写一个 PL/SQL 过程来创建与另一个帐户中的表匹配的表(我有权访问该帐户)。它们需要具有相同的列和类型。此外,它们需要填充相同的数据
帮我!
编辑:
SQL> CREATE OR REPLACE PROCEDURE MakeTables
2 AS
3 BEGIN
4 EXECUTE IMMEDIATE
5 'CREATE TABLE Table1 AS (SELECT * FROM ANOTHER_ACCT.Table1);
6 CREATE TABLE Table2 AS (SELECT * FROM ANOTHER_ACCT.Table2);
7 CREATE TABLE Table3 AS (SELECT * FROM ANOTHER_ACCT.Table3);
8 CREATE TABLE Table4 AS (SELECT * FROM ANOTHER_ACCT.Table4)';
9 END;
10 /
Procedure created.
但是当我运行它时,我得到了这个错误:
SQL> BEGIN
2 MakeTables;
3 END;
4 /
BEGIN
*
ERROR at line 1:
ORA-00911: invalid character
ORA-06512: at "BS135.MAKETABLES", line 4
ORA-06512: at line 2