Re: dbms_metadata.get_ddl

From: Andrew Kerber <andrew.kerber_at_gmail.com>
Date: Mon, 30 Sep 2013 10:17:51 -0500
Message-ID: <CAJvnOJYgAHCHeNQmx-rTkPSSoJXqiy1yw56pDw0Mi7EsA-ckxA_at_mail.gmail.com>



How are you trying to use the procedure? If you want to generated ddl that you then modify to create your own objects, then you want formatted output. If you are generating the ddl and creating your own object within code, you do not want to format the output, you just want to execute the the output. I was doing some mass table moves at one point, and discovered this. When I formatted the output it would not run, if I left it unformatted it ran fine.

<SNIP

>
> -----Original Message-----
> From: oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org]
> On Behalf Of Ray Stell
> Sent: Monday, September 30, 2013 10:15 AM
> To: oracle-l_at_freelists.org
> Subject: dbms_metadata.get_ddl
>
> Whenever I try to use the dbms_metadata.get_ddl the output is not valid.
> I think the issue must be terminal related.
> The docs say use these:
>
> SQL> SET PAGESIZE 0
> SQL> SET LONG 1000000
> SQL> SELECT get_table_md FROM dual;
>
> and then shows perfectly formated output. I wonder what editor they used
> to repair the damage? When I use it there are linebreaks in the middle of
> strings that produce errors.
>
> This thread https://forums.oracle.com/thread/703189 reports using:
>
> set pagesize 0
> set long 90000
> set lines 131
> column txt format a121 word_wrapped
> set longchunksize to 250
>
> This seemed to work a little better, but I feel like it won't on the next
> object. Tom has this rambling thread:
>
> http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:30802454515375
>
> Seems like rather a fishing expedition. Is there some magic that just
> works?
>
> TIA
> --
> http://www.freelists.org/webpage/oracle-l
>
>
> --
> http://www.freelists.org/webpage/oracle-l
>
>
>

-- 
Andrew W. Kerber

'If at first you dont succeed, dont take up skydiving.'


--
http://www.freelists.org/webpage/oracle-l
Received on Mon Sep 30 2013 - 17:17:51 CEST

Original text of this message