소프트웨어 테스트 목적으로 '황금 데이터'테이블 중복 세트를 만들 수 있도록 데이터베이스의 테이블 정의를 반복 실행하고 DDL을 추출 중입니다. . 아래 코드는 ORA-06502 오류가 발생하는 테이블 하나까지 DDL을 추출합니다. 문제는 DDL이 CLOB로 반환되는 변수를 정의했기 때문에 충분히 커야합니다. 코드는 다음과 같습니다.이상한 ORA-06502 : PL/SQL : 숫자 또는 값 오류
create or replace
procedure gettabledescription as
current_date_time varchar2(32);
sql_statement varchar2(200);
ddl_return clob;
new_ddl clob;
BEGIN
DBMS_OUTPUT.ENABLE;
current_date_time:= to_char(sysdate,'MM/DD/YYYY - HH24:MI:SS');
dbms_output.put_line(current_date_time);
for cursor_rec in (select * from user_objects where object_type='TABLE' and object_name not like 'TM%' and object_name not like 'TZ_%' and object_name not like 'EXT_%' and object_name not like 'RPT_%' and object_name not like 'ETL_%') loop
sql_statement := 'select dbms_metadata.get_ddl(''TABLE'',' || '''' || cursor_rec.object_name || '''' || ') from dual';
execute immediate sql_statement into ddl_return;
**error thrown here** new_ddl := replace(ddl_return,TO_CHAR(cursor_rec.object_name),'QA_' || TO_CHAR(cursor_rec.object_name));
dbms_output.put_line(new_ddl);
end loop;
END GETTABLEDESCRIPTION;
왜 나는 오류가 발생하는지 이해할 수 없습니다.
1) 오류가 발생하는 라인은 무엇입니까? –
"new_ddl"줄에. –