dbms_metadata.get_ddl output format is not runable.
509615Sep 2 2008 — edited Sep 2 2008Hi,
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.