MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

how to find out all nullable columns in a DB2 table ?

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
mahesh_chv
Beginner


Joined: 04 Aug 2005
Posts: 41
Topics: 16

PostPosted: Tue Mar 31, 2009 1:45 am    Post subject: how to find out all nullable columns in a DB2 table ? Reply with quote

We are currently using DB2 V7 and want to migrate to Db2 V9. So we are coming with a tool which can find out all the nullable columns in Db2 tables and

Currently we don't have null indicators for some of the fields, so we need to find the list of all the null columns which don't have null indicators in cobol programs.

In our DCLGEN we don't have null indicators. Most of the programs have declared working storage variables for null indicators.

Is there any way to find out all Nullable columns of all the tables in a DB2
Back to top
View user's profile Send private message
sriramla
Beginner


Joined: 22 Feb 2003
Posts: 74
Topics: 1

PostPosted: Tue Mar 31, 2009 4:08 am    Post subject: Reply with quote

I believe sysibm.syscolumns table has this information. Look at the column named "NULLS". If it is "Y" then the column is nullable; otherwise not.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Tue Mar 31, 2009 11:15 am    Post subject: Reply with quote

mahesh_chv,

Try this
Code:

SELECT NAME               
      ,COLNO             
      ,COLTYPE           
      ,LENGTH             
      ,SCALE             
  FROM SYSIBM.SYSCOLUMNS 
 WHERE TBNAME = 'Your table name' 
   AND NULLS  = 'Y'       
   ;                     


Here is the explanation of all the columns of SYSIBM.SYSCOLUMNS table

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DSNSQJ12/F.19?

Kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group