Oracle - Query to get TABLE Script

If we want a table script , most of us use toad or some other GUI tool to get the script.

Here is the syntax, where we can get the script from SQL client(CUI):

SELECT DBMS_METADATA.GET_DDL('TABLE', u.TABLE_name) FROM User_TABLES u;

SELECT DBMS_METADATA.GET_DDL('INDEX', u.index_name) FROM USER_INDEXES u;

Regards

D.Sasi Kumar

 

0 comments: