Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to get DDL for view

Girish SharmaApr 21 2008 — edited Apr 21 2008
Hello,

I am using oracle 9i and windows XP. Though we can get the source from following query:

HR@orcl> SELECT TEXT FROM USER_VIEWS WHERE VIEW_NAME='EMP_DETAILS_VIEW';

But, if i wish to get the DDL from dbms_metadata.ddl then it is returning error.

HR@orcl> set heading off;
HR@orcl> set echo off;
HR@orcl> Set pages 999;
HR@orcl> set long 90000;
HR@orcl> SELECT DBMS_METADATA.GET_DDL('VIEW','EMP_DETAILS_VIEW','HR') FROM DUAL;

ERROR:
ORA-19206: Invalid value for query or REF CURSOR parameter
ORA-06512: at "SYS.DBMS_XMLGEN", line 83
ORA-06512: at "SYS.DBMS_METADATA", line 345
ORA-06512: at "SYS.DBMS_METADATA", line 410
ORA-06512: at "SYS.DBMS_METADATA", line 449
ORA-06512: at "SYS.DBMS_METADATA", line 615
ORA-06512: at "SYS.DBMS_METADATA", line 1221
ORA-06512: at line 1

Thanks & Regards
Girish Sharma
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 19 2008
Added on Apr 21 2008
20 comments
40,838 views