有人可以帮助解决这个错误吗?我无法编写此的 pl/sql 查询。谢谢。
spool 150OMGIddl.sql
declare c clob;
begin
SELECT DBMS_METADATA.GET_DDL('TABLE',u.table_name,'150OMGI') into c from dba_tables u where owner='150OMGI';
dbms_output.put_line(c);
dbms_output.put(';');
end;
/
spool off
错误:
ERROR at line 1:
ORA-01422: exact fetch returns more than requested number of rows
ORA-06512: at line 3
当我跑步时,SELECT DBMS_METADATA.GET_DDL('TABLE',u.table_name,'150OMGI') from dba_tables u where owner='150OMGI';
我有 26 行。
该脚本只需要 1 行。不是你得到的 26。您必须使用游标并循环遍历您获得的行: