473,406 Members | 2,220 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Generating CREATE TABLE statements for a table

Hi,

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

Regards,
Jack
Feb 1 '06 #1
9 5223
Jack Miller wrote:
Hi,

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

Regards,
Jack

take a look at db2look :-)

--
Serge Rielau
DB2 Solutions Development
DB2 UDB for Linux, Unix, Windows
IBM Toronto Lab
Feb 1 '06 #2
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:
Jack Miller wrote:
Hi,

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

Regards,
Jack

take a look at db2look :-)

Feb 1 '06 #3
"Jack Miller" <jm@asdfaf.com> wrote in message
news:Hw8Ef.5715$J81.633@trndny01...
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


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.
Feb 2 '06 #4
Jack Miller wrote:
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')

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
Feb 2 '06 #5
Whoa! You sent out this code and didn't make it public?

Post it please. :)

B.

Feb 2 '06 #6
Brian Tkatch wrote:
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 :-)

--
Serge Rielau
DB2 Solutions Development
DB2 UDB for Linux, Unix, Windows
IBM Toronto Lab
Feb 2 '06 #7
Ah, ok.

I can see it being usefull.

B.

Feb 2 '06 #8
Serge Rielau wrote:
Brian Tkatch wrote:
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 :-)

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
Feb 9 '06 #9
Thanx Serge!

B.

Feb 14 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Justin Lebar | last post by:
Sorry about the huge post, but I think this is the amount of information necessary for someone to help me with a good answer. I'm writing a statistical analysis program in ASP.net and MSSQL7 that...
1
by: teohster | last post by:
Hi all, What I am trying to do is generate a stored procedure that is desired to output XML in this type of format <Parent Device> <Device> <Device ID>1</DeviceID> <ChildRegister>...
12
by: Martin_Hurst | last post by:
Has some one come up with a similar type script that could be used in a Postgresql database? The script below was created for a SQLServer database. Thx, -Martin ...
2
by: tom horner | last post by:
Any ideas on why drop and create alias statements would take a long time? We recently went through an upgrade of our production database, which included alter statements to table structures,...
1
by: jan | last post by:
Hello, I am new to this list and would appreciate some help with Access 2000 and Access 2003. I need to export our access database table statements by access database to place into our database...
0
by: Gary Miller | last post by:
I am using a Oracle 817. I generated an intial DataAdapter and DataSet. All statements geneated; Select, Update, Inssert and Delete. I add a new column to the Table, null allowed, varchar2. ...
1
by: Jack Miller | last post by:
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...
8
by: matt | last post by:
hello, can anyone speak to some of the common or preferred methods for building Excel .XLS files, programmatically thru the .NET framework? i have an intranet app that needs to generate &...
5
by: Arun Srinivasan | last post by:
I am trying to generate sql from sql. Like select 'select count(*) from ' || tabschema ..............syscat.tables where.....; is there a way to run this with a single statement? I tried with...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.