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 first published in March 2006

Dig deeper on Oracle and SQL

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

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.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide

SearchDataCenter

SearchContentManagement

SearchFinancialApplications

Close