Q

Script for tables created in SQL

How to get the script (SQL) for the tables created in SQL script?

How to get the script (SQL) for the tables created in SQL script?
You can use the DBMS_METADATA package to reverse-engineer the CREATE TABLE command for any table in the database. You can perform a query similar to the following:
SELECT dbms_metadata.get_ddl('TABLE','EMP','SCOTT') FROM dual;
Or, you can query for all of your tables using the Data Dictionary:
SELECT dbms_metadata.get_ddl('TABLE',table_name,USER) FROM user_tables;
This was last published in March 2006

Dig Deeper on Oracle and SQL

PRO+

Content

Find more PRO+ content and other member only offers, here.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide

SearchDataCenter

SearchContentManagement

SearchFinancialApplications

Close