Q
Problem solve Get help with specific problems with your technologies, process and projects.

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;

Dig Deeper on Oracle and SQL

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.

Please create a username to comment.

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide.com

SearchDataCenter

SearchContentManagement

SearchHRSoftware

Close