Connecting Tech Pros Worldwide Help | Site Map

Generating CREATE TABLE statements for a table

Jack Miller
Guest
 
Posts: n/a
#1: Feb 1 '06
Hi,

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

Regards,
Jack
Serge Rielau
Guest
 
Posts: n/a
#2: Feb 1 '06

re: Generating CREATE TABLE statements for a table


Jack Miller wrote:[color=blue]
> Hi,
>
> Is there any SQL that would return the "CREATE TABLE" statement for an
> existing table in the database?
>
> Regards,
> Jack[/color]
take a look at db2look :-)

--
Serge Rielau
DB2 Solutions Development
DB2 UDB for Linux, Unix, Windows
IBM Toronto Lab
Jack Miller
Guest
 
Posts: n/a
#3: Feb 1 '06

re: Generating CREATE TABLE statements for a table


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


Serge Rielau wrote:[color=blue]
> Jack Miller wrote:[color=green]
>> Hi,
>>
>> Is there any SQL that would return the "CREATE TABLE" statement for an
>> existing table in the database?
>>
>> Regards,
>> Jack[/color]
> take a look at db2look :-)
>[/color]
Mark A
Guest
 
Posts: n/a
#4: Feb 2 '06

re: Generating CREATE TABLE statements for a table


"Jack Miller" <jm@asdfaf.com> wrote in message
news:Hw8Ef.5715$J81.633@trndny01...[color=blue]
> 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
>
>[/color]

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
Guest
 
Posts: n/a
#5: Feb 2 '06

re: Generating CREATE TABLE statements for a table


Jack Miller wrote:[color=blue]
> 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')
>[/color]
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
--
Serge Rielau
DB2 Solutions Development
DB2 UDB for Linux, Unix, Windows
IBM Toronto Lab
Brian Tkatch
Guest
 
Posts: n/a
#6: Feb 2 '06

re: Generating CREATE TABLE statements for a table


Whoa! You sent out this code and didn't make it public?

Post it please. :)

B.

Serge Rielau
Guest
 
Posts: n/a
#7: Feb 2 '06

re: Generating CREATE TABLE statements for a table


Brian Tkatch wrote:[color=blue]
> Whoa! You sent out this code and didn't make it public?
>
> Post it please. :)
>
> B.
>[/color]
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 :-)

--
Serge Rielau
DB2 Solutions Development
DB2 UDB for Linux, Unix, Windows
IBM Toronto Lab
Brian Tkatch
Guest
 
Posts: n/a
#8: Feb 2 '06

re: Generating CREATE TABLE statements for a table


Ah, ok.

I can see it being usefull.

B.

Serge Rielau
Guest
 
Posts: n/a
#9: Feb 9 '06

re: Generating CREATE TABLE statements for a table


Serge Rielau wrote:[color=blue]
> Brian Tkatch wrote:
>[color=green]
>> Whoa! You sent out this code and didn't make it public?
>>
>> Post it please. :)
>>
>> B.
>>[/color]
> 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 :-)
>[/color]
Tadah!

http://www-128.ibm.com/developerwork...dm-0602rielau/

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
DB2 UDB for Linux, Unix, Windows
IBM Toronto Lab
Brian Tkatch
Guest
 
Posts: n/a
#10: Feb 14 '06

re: Generating CREATE TABLE statements for a table


Thanx Serge!

B.

Closed Thread