473,598 Members | 3,266 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5238
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.G ET_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.co m> wrote in message
news:Hw8Ef.5715 $J81.633@trndny 01...
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.G ET_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.G ET_DDL('TABLE', 'TABLENAME')

Faszinating...I f 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
3013
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 analyzes data that I've collected from my business's webpage and the hits it's collecting from the various pay-per-click (PPC) engines. I've arrived at problems writing a SQL call to generate certain statistics. Whenever someone enters our...
1
2140
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> <ChildRegisterID>22</ChildRegisterID>
12
2483
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 ++++++++++++++++++++++++++++++++++++++ http://searchdatabase.techtarget.com/tip/1,289483,sid13_gci913717,00.html In the early stages of application design DBA or a developer creates a data
2
2621
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, create tables, drop tables, and data inserts, deletes, and updates. Also, we dropped and recreated all the alias's we had on the tables and views to those tables. We are on UDB 7.2, FP7, on AIX. Everything took about the same time as in our...
1
2207
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 model repository. We have several different relational databases, of which access is one, so we want to keep all of the SQL that creates tables in a single model repository. Is there some way within the access tool to export this information? I...
0
881
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. When I try and re-generate the DataAdapter it tells me it got an error generating the Delete and Update statements. WHY????
1
8966
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 sent from any client and it returns the script for the table.
8
2452
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 & email .xls files for users. these are not reports, but rather more like forms. its a pretty simple doc, two worksheets -- the first is basic info common to all recepients. the second is a simple data table that, depending on the recepient, contains...
5
1819
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 temp1(sql) as ( select 'select count(*) from ' || tabschema ..............syscat.tables where.....;
0
7987
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7899
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8397
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
5850
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5438
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3897
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2412
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1504
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1250
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.