Wednesday, May 8, 2013

Getting metadata of a table

Use the DBMS_METADATA package's GET_DDL procedure to get DDL of the object

Snap above shows the usage of DBMS_METADATA.GET_DDL to get definition of table

SELECT DBMS_METADATA.GET_DDL('OBJECT_TYPE','OBJECT_NAME','OWNER') FROM DUAL;


Where 
OBJECT_TYPE   ----> table in above case
OBJECT_NAME ----> name of table
OWNER              ----> Owner of table.

Similary for Views


No comments:

Post a Comment