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!

dbms_metadata.get_ddl output format is not runable.

509615Sep 2 2008 — edited Sep 2 2008
Hi,

I am using dbms_metadata.get_ddl to extract the objects. But the output returned is not runable.
In output lines are broken so it makes unable to run that code.

Ex. If I run this for all the synonyms like this.

set pagesize 0
set long 90000
set feedback off
set echo off
spool /tmp/FixSyn.out
select
DBMS_METADATA.GET_DDL('SYNONYM',u.object_name,'ADMINSRV_D1')
from
dba_objects u
where
object_type = 'SYNONYM' and owner= 'ADMINSRV_D1';
spool off;

Output from this is coming like this.

CREATE OR REPLACE SYNONYM "ADMINSRV_D1"."ASSTATEAPPORVALTYPE222" FOR "ADMINSRV

_D1"."ASSTATEAPPORVALTYPE";



CREATE OR REPLACE SYNONYM "ABC"."ASSTATEAPPORVALTYPE3" FOR "ADMINSRV_D

1"."ASSTATEAPPORVALTYPE";


This is broken in multiple lines so not possible to run this.
Please provide any solution to fix this output.

Thanks a lot,
Amit.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 30 2008
Added on Sep 2 2008
3 comments
3,333 views