Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / February 2006

Tip: Looking for answers? Try searching our database.

Generating CREATE TABLE statements for a table

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jack Miller - 01 Feb 2006 19:16 GMT
Hi,

Is there any SQL that would return the "CREATE TABLE" statement for an
existing table in the database?

Regards,
Jack
Serge Rielau - 01 Feb 2006 19:29 GMT
> Hi,
>
[quoted text clipped - 3 lines]
> Regards,
> Jack
take a look at db2look :-)

Signature

Serge Rielau
DB2 Solutions Development
DB2 UDB for Linux, Unix, Windows
IBM Toronto Lab

Jack Miller - 01 Feb 2006 20:05 GMT
Serge,

Thanks for a prompt response. I am looking for an SQL statement that I
could send from my VB program. db2look is a program by itself and it
will reside on my server. What I am looking is a an equivalent of
Oracle's command:

DBMS_METADATA.GET_DDL('TABLE', 'TABLENAME')

Regards,
Jack

>> Hi,
>>
[quoted text clipped - 4 lines]
>> Jack
> take a look at db2look :-)
Mark A - 02 Feb 2006 01:23 GMT
> Serge,
>
[quoted text clipped - 7 lines]
> Regards,
> Jack

Look at the catalog (SYSCAT) views in the appendix of SQL Reference Vol I.
This contains all the metadata you need to construct such an SQL statement.
Serge Rielau - 02 Feb 2006 01:50 GMT
> Serge,
>
[quoted text clipped - 4 lines]
>
> DBMS_METADATA.GET_DDL('TABLE', 'TABLENAME')

Faszinating...If I keep sending code out like this there is no need to
publish anymore... Check your in-box.
(assuming your email address is real)

Cheers
Serge
Signature

Serge Rielau
DB2 Solutions Development
DB2 UDB for Linux, Unix, Windows
IBM Toronto Lab

Brian Tkatch - 02 Feb 2006 15:18 GMT
Whoa! You sent out this code and didn't make it public?

Post it please. :)

B.
Serge Rielau - 02 Feb 2006 16:23 GMT
> Whoa! You sent out this code and didn't make it public?
>
> Post it please. :)
>
> B.

It's lengthy. It'll go to developerWorks.. Just waiting for a slot.
Also I'd like those folks to beta test before embarassing myself to the
world :-)

Signature

Serge Rielau
DB2 Solutions Development
DB2 UDB for Linux, Unix, Windows
IBM Toronto Lab

Brian Tkatch - 02 Feb 2006 17:01 GMT
Ah, ok.

I can see it being usefull.

B.
Serge Rielau - 09 Feb 2006 20:59 GMT
>> Whoa! You sent out this code and didn't make it public?
>>
[quoted text clipped - 5 lines]
> Also I'd like those folks to beta test before embarassing myself to the
> world :-)

Tadah!

http://www-128.ibm.com/developerworks/db2/library/techarticle/dm-0602rielau/

Cheers
Serge
Signature

Serge Rielau
DB2 Solutions Development
DB2 UDB for Linux, Unix, Windows
IBM Toronto Lab

Brian Tkatch - 14 Feb 2006 18:40 GMT
Thanx Serge!

B.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.