Skip to Main Content

SQL & PL/SQL

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!

Getting DDL for all oracle objects

J1604Jun 8 2012 — edited Jun 8 2012
I am working to get the DDL for all the oracle objects within my schema.

Some how I got the DDL but I can't got the comments associated with the oracle tables.

Shall I know what I am missing in using dbms_package I am currently using ..?

Below is the sql I am using to get DDL

SELECT dbms_metadata.get_ddl(replace(OBJECT_TYPE, ' ', '_'), OBJECT_NAME,OWNER)
FROM DBA_OBJECTS
WHERE OBJECT_TYPE in ('SEQUENCE',
'PROCEDURE',
--'DATABASE LINK',
'PACKAGE',
'PACKAGE BODY',
'MATERIALIZED VIEW',
'TABLE',
'INDEX',
'VIEW',
'FUNCTION')
AND
OWNER = 'Schema_1';

Can I know what needs to be changed to above sql to get comments on oracle tables along with their DDL.

Any advise is highly appreciated.
Thanks
JP
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 6 2012
Added on Jun 8 2012
7 comments
9,305 views