View Single Post

   
  #5 (permalink)  
Old 02-25-2008, 02:58 AM
Walt
 
Posts: n/a
Default Re: Generating CREATE TABLE statements

DA Morgan wrote:
> Jack Miller wrote:


>> Is there any SQL command in Oracle that returns a "CREATE TABLE"
>> statement in Oracle. For example in MySQL there is a command called
>>
>> "SHOW CREATE TABLE <tableName>"
>>
>> This command can be sent from any client and it returns the script for


> SELECT dbms_metadata.get_data('TABLE', '<you_table_name>')
> FROM dual;


ITYM dbms_metadata.get_ddl()

> Demos of the dbms_metadata package can be found in Morgan's Library at
> www.psoug.org.


The OP didn't include an Oracle version, so for those playing along at
home the dbms_metadata package was new in Oracle 9i.

Also, TOAD and Raptor provide a point and click interface to generate
create table scripts.

//Walt

Reply With Quote