DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: How to get the script for a Oracle Table

  1. #1
    Join Date
    Feb 2004
    Location
    U.K.
    Posts
    1

    How to get the script for a Oracle Table

    Hi,
    My requirement is to write a SQL which would give me the full script about a table. ( The full syntax when we create a table ).It should also include the constraints,indexes and privileges.
    I am giving an example.

    CREATE TABLE ABC
    (
    ID NUMBER(12,2) NOT NULL,
    USED_DATE DATE NOT NULL,
    MSISDN NUMBER NOT NULL DEFAULT 0,
    CONSTRAINT PK_ABC
    PRIMARY KEY ( ID, USED_DATE)
    USING INDEX
    TABLESPACE IND
    )

    CREATE INDEX X1_VOU_POD ON ABC(MSISDN)
    TABLESPACE IND

  2. #2
    Join Date
    Jun 2000
    Location
    Madrid, Spain
    Posts
    7,447
    use dbms_metadata

  3. #3
    Join Date
    Feb 2004
    Location
    Mumbai, Maharastra
    Posts
    67

    Exclamation

    USE THE FOLLOWING SCRIPT

    SELECT DBMS_METADATA.GET_DDL('TABLE','TEST','USER1') FROM DUAL;
    Regards,
    Surajit K Mitra

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