vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi, 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 the table. Thanks |
| |||
| Jack Miller wrote: > Hi, > > 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 > the table. > > Thanks Please do not feel compelled to multipost to every usenet group you can spell. SELECT dbms_metadata.get_data('TABLE', '<you_table_name>') FROM dual; Demos of the dbms_metadata package can be found in Morgan's Library at www.psoug.org. -- Daniel A. Morgan http://www.psoug.org damorgan@x.washington.edu (replace x with u to respond) |
| |||
| "Jack Miller" <jm@asdfaf.com> wrote in message news:swrDf.2327$0J3.1435@trndny08... > Hi, > > 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 > the table. > > Thanks look at the docs under pl/sql packages dbms_metadata. Jim |
| |||
| Jack Miller wrote: > Hi, > > 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 > the table. > > Thanks Oracle's Raptor has a tab (subwindow) called "SQL" for table. It shows the create table (tablespace etc. included), grants, indexes, primary and foreign keys. -- Arto Viitanen, CSC Ltd Espoo, Finland |
| ||||
| 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 |