Plsql 试图从没有行的架构中删除所有表?

Plsql 试图从没有行的架构中删除所有表?,plsql,plsqldeveloper,Plsql,Plsqldeveloper,我试图删除模式中没有行的所有表,但在执行此代码时 我犯了一个错误 THis is the code: create or replace procedure tester IS v_count NUMBER; CURSOR emp_cur IS select table_name from user_tables; BEGIN FOR emp_rec_cur IN emp_cur LOOP

我试图删除模式中没有行的所有表,但在执行此代码时 我犯了一个错误

THis is the code:


 create or replace procedure tester
       IS
       v_count NUMBER;
       CURSOR emp_cur
      IS
      select table_name from user_tables;
      BEGIN
          FOR emp_rec_cur IN emp_cur LOOP
            EXECUTE IMMEDIATE 'select count(*) from '|| emp_rec_cur.table_name INTO   v_count ;
            IF v_count =0 THEN
           EXECUTE  IMMEDIATE 'DROP TABLE '|| emp_rec_cur.table_name;
               END IF;
              END LOOP;
      END tester;

ERROR at line 1:
ORA-29913: error in executing ODCIEXTTABLEOPEN callout
ORA-29400: data cartridge error
KUP-00554: error encountered while parsing access parameters
KUP-01005: syntax error: found "identifier": expecting one of: "badfile, byteordermark, characterset, data, delimited, discardfile, exit, fields,
fixed, load, logfile, nodiscardfile, nobadfile, nologfile, date_cache, processing, readsize, string, skip, variable"
KUP-01008: the bad identifier was: DELIMETED
KUP-01007: at line 1 column 9
ORA-06512: at "SYS.ORACLE_LOADER", line 14
ORA-06512: at line 1
ORA-06512: at "SCOTT.TESTER", line 9
ORA-06512: at line 1

ORACLE_加载程序正在引发此错误。我怀疑您的循环正在查找一个外部表,该表的定义有问题-KUP-01008正在抱怨关键字“delimetered”,但外部表语法包含关键字“DELIMITED”

如果不打算删除外部表,可能需要在查询中省略它们,例如:

CURSOR emp_cur IS
SELECT table_name FROM user_tables
MINUS
SELECT table_name FROM user_external_tables;

ORACLE_加载程序正在引发此错误。我怀疑您的循环正在查找一个外部表,该表的定义有问题-KUP-01008正在抱怨关键字“delimetered”,但外部表语法包含关键字“DELIMITED”

如果不打算删除外部表,可能需要在查询中省略它们,例如:

CURSOR emp_cur IS
SELECT table_name FROM user_tables
MINUS
SELECT table_name FROM user_external_tables;

为了使这段代码更加防弹,我建议用双引号将表名括起来,例如“DROP table”| | | emp_rec_cur.table| | |“;为了使这段代码更加防弹,我建议用双引号将表名括起来,例如“DROP table”| | | emp_rec_cur.table| | |“;