Page 1 of 1

Recreate SQL used to define an existing table

PostPosted: Thu Apr 12, 2012 4:19 pm
by humble
Hi, Is it possible to recreate the SQL used to define an existing table?
I need to do this because there is no documentation available on a table defined long ago.
Can I use any QMF options or other tools? please suggest.

I am starting by analyzing the Db2 catalogs.

Re: Recreate SQL used to define an existing table

PostPosted: Thu Apr 12, 2012 4:47 pm
by Akatsukami
Start with the following query:
SELECT COLNO, NAME, COLTYPE, LENGTH, NULLS FROM SYSIBM.SYSCOLUMNS
WHERE TBNAME = 'table in question'
ORDER BY COLNO

Re: Recreate SQL used to define an existing table

PostPosted: Thu Apr 12, 2012 8:43 pm
by GuyC
DataStudio