How to get the script for a Oracle Table
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,
PRIMARY KEY ( ID, USED_DATE)
CREATE INDEX X1_VOU_POD ON ABC(MSISDN)
USE THE FOLLOWING SCRIPT
SELECT DBMS_METADATA.GET_DDL('TABLE','TEST','USER1') FROM DUAL;
Surajit K Mitra
Click Here to Expand Forum to Full Width