0
내가 어떤 행과 스키마의 모든 테이블을 삭제하기 위해 노력하고 있어요,하지만 난이 코드 를 실행하고 때 오류행이없는 스키마에서 모든 테이블을 삭제하려고합니까?
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
이 코드 더 방탄하려면 난 당신이 테이블 이름을 둘러싸고 좋을 것 큰 따옴표 - 예 : 'DROP TABLE "'|| emp_rec_cur.table_name || '"'; –