Home » SQL & PL/SQL » SQL & PL/SQL » spool table script
spool table script [message #220566] Wed, 21 February 2007 05:12 Go to next message
oracle_coorgi
Messages: 185
Registered: September 2006
Location: INDIA-karnataka
Senior Member
hi
i need to spool the create table script for all the table from the user with constraints
eg: in toad export table script
thanxs


Re: spool table script [message #220572 is a reply to message #220566] Wed, 21 February 2007 05:16 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10672
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
search for dbms_metadata in this forum/docs/google.
Re: spool table script [message #220575 is a reply to message #220572] Wed, 21 February 2007 05:20 Go to previous messageGo to next message
tahpush
Messages: 961
Registered: August 2006
Location: Stockholm/Sweden
Senior Member

ex
select dbms_metadata.get_ddl('TABLE','DEPT','SCOTT') from dual;


ex
select dbms_metadata.get_ddl('INDEX','DEPT_IDX','SCOTT') from dual;

Re: spool table script [message #221585 is a reply to message #220566] Tue, 27 February 2007 09:41 Go to previous message
rikfair
Messages: 22
Registered: October 2006
Location: UK
Junior Member
Hi

The following link has an example for generating create scripts, for specific object types, for a given schema, using dbms_metadata.

http://www.astral-consultancy.co.uk/cgi-bin/hunbug/doco.cgi?11300

Hope this helps
Razz
Previous Topic: PLS-00201 - identifier declaration error - in resultset query
Next Topic: Calling Function within a package
Goto Forum:
  


Current Time: Tue Dec 06 13:52:43 CST 2016

Total time taken to generate the page: 0.12476 seconds