DBAsupport.com Forums - Powered by vBulletin
Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Table creation script

  1. #1
    Join Date
    Jan 2000
    Posts
    387

    Table creation script

    Hi

    There is a script generated for table creation and all related procedures or triggers related to the table under the script tab in the software product TOAD. I am encountering an invalid operation now and cannot retrieve the scripts, does anyone has the sql to extract all the script creation for a table please? Thanks!

  2. #2
    Join Date
    Sep 2002
    Location
    England
    Posts
    7,334
    version would help

  3. #3
    Join Date
    Jan 2000
    Posts
    387
    Version 9.2.0.4.0. Thank you!

  4. #4
    Join Date
    Sep 2002
    Location
    England
    Posts
    7,334
    use dbms_metadata.get_ddl

  5. #5
    Join Date
    Jan 2000
    Posts
    387
    Hi

    I have tested it and it doesn't work :( Any help please? Thanks in advance!

    select dbms_metadata.get_ddl('TABLE','EMP') from dual;

    ERROR:
    ORA-06502: PL/SQL: numeric or value error
    ORA-31605: the following was returned from LpxXSLResetAllVars in routine
    kuxslResetParams:
    LPX-1: NULL pointer
    ORA-06512: at "SYS.UTL_XML", line 0
    ORA-06512: at "SYS.DBMS_METADATA_INT", line 3320
    ORA-06512: at "SYS.DBMS_METADATA_INT", line 4148
    ORA-06512: at "SYS.DBMS_METADATA", line 458
    ORA-06512: at "SYS.DBMS_METADATA", line 615
    ORA-06512: at "SYS.DBMS_METADATA", line 1221
    ORA-06512: at line 1

  6. #6
    Join Date
    Aug 2000
    Location
    Jolo, Sulu
    Posts
    639
    hi hun,

    i do export the table witn no rows and edit the expdat.dmp all the
    ddl is there or import using indexfile=file and your ddl sql is ready.

  7. #7
    Join Date
    Jan 2000
    Posts
    387
    Thanks! But any idea why dbms_metadata.get_ddl is not working?

  8. #8
    Join Date
    Aug 2000
    Location
    Jolo, Sulu
    Posts
    639
    funny...it worked on my 9.2.0.1 and 10.1.0.2 believe me the output
    is no good. It just returned a truncated 1 liner.

    Maybe u need to exit and login again or reboot

  9. #9
    Join Date
    Aug 2000
    Location
    Jolo, Sulu
    Posts
    639
    funny...it worked on my 9.2.0.1 and 10.1.0.2 believe me the output
    is no good. It just returned a truncated 1 liner.

    Maybe u need to exit and login again or reboot

  10. #10
    Join Date
    Jan 2000
    Posts
    387
    I think you can set long=10000 to see more lines. Could it be my Oracle version which is having problem with dbms_metadata.get_ddl? Anyone encountering the same error??

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width