IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

SQL to Retrive the records which one haven null values


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
philipraju
Warnings : 1

New User


Joined: 16 Apr 2006
Posts: 29

PostPosted: Tue Jun 20, 2006 11:01 pm
Reply with quote

Hi any one gives query to the below one

I want to retrive the records which one haven null values...i dont know in which colomun i haven null value...so i want to check all the columns....is it possible without specifying the all coloumns in where clause...pls reply to me
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Wed Jun 21, 2006 2:29 am
Reply with quote

I think what you want to do is not possible.

You are going to have to list each column. (Cut the column list from the DCLGNLIB).

If you find another way, please come back and post it for the rest of us.

Dave
Back to top
View user's profile Send private message
anamikak

New User


Joined: 10 May 2006
Posts: 64
Location: Singapore

PostPosted: Thu Jun 22, 2006 5:05 am
Reply with quote

To Mininmize the list of column names in your query, you can first query SYSIBM.SYSCOLUMNS as

select name from SYSIBM.SYSCOLUMNS

where TBNAME ='your table name'
AND NULLS = 'Y';


this would give you the list of nullable columns

and then in your second query you can check for IS NULL.

Anamika
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Null values are considered in Total c... DFSORT/ICETOOL 6
Search our Forums:

Back to Top