tags:

views:

82

answers:

3

SQL Server has a way to let you "export" an existing table's schema, in the form of its necessary SQL "Create Table" commands.

How do you do this in Oracle? Is there a nice automated way of doing it?

+1  A: 

You can use SQLDeveloper for this. It is freely available and you can just right click on the table and can export the DDL query,export data in various format,etc.

Below is the link to sample Export HOW-To http://www.oracle.com/technology/products/database/sql%5Fdeveloper/howtos/export%5Fintro.htm

+2  A: 

Using a tool like SQL Developer or Toad is probably simplest. But the information is all available in the data dictionary. In particular, check the documentation for DBMS_METADATA.get_ddl. Something like

select dbms_metadata.get_ddl ('TABLE',myschema,mytab) from dual;

should do what you want.

Jim Hudson