Amazon

Friday, May 25, 2012

Fetching create table script of Oracle Tables

spool off
/
-----Open file to dump the output of procedure
spool table_struct_data.txt
/

set serveroutput on
/
declare
       l_data varchar2(10000);
       l_clob clob;
begin
----------select the DDL script of table using GET_DDL Oracle Library
       select DBMS_METADATA.GET_DDL('TABLE','MASTER_TAB') into
l_clob from DUAL;
       l_data := dbms_lob.substr( l_clob, 4245, 1 );
       dbms_output.put_line( l_data);

end;
/
spool off


open the file table_struct_data.txt . It will contain the create script of table MASTER_TAB

No comments:

Post a Comment

Amazon Best Sellors

Weblogic - Server Creation - Issues

Datasource creation using python script.  Python Script was failing after creating Datasource. From UI Admin Console, if I try to activat...