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

NULL value in a NOT NULL column


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

New User


Joined: 17 Jan 2008
Posts: 25
Location: Chennai

PostPosted: Wed Feb 18, 2009 1:02 am
Reply with quote

Hi,

SELECT * FROM TRX
WHERE TRX.NAME = 'KR'
AND LOCK_A IS NOT NULL
WITH UR;

LOCK_A is a CHAR(1) field. Above query gives me a record which when i put HEX ON displays a value '00'.

I understand '00' is a null value. Please advise.

Thanks,
Soundar
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Wed Feb 18, 2009 1:11 am
Reply with quote

Quote:
I understand '00' is a null value.
True enough, but in the world of DBAs, their "null" means more like "does not exist", not that the column contain null values. X'00' is data, just like alpha or numeric data......
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Feb 18, 2009 1:35 am
Reply with quote

Hello,

Quote:
I understand '00' is a null value. Please advise.
A common mis-understanding. . .

x'00' is also known as low-values, hex zeros, and binary zeros. All of which are values. NULL is the absence of any value. The condition may be tested (i.e. IS NULL), but there can be no compare for some value that is null.
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 Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts How to load to DB2 with column level ... DB2 6
No new posts RC query -Time column CA Products 3
No new posts Null values are considered in Total c... DFSORT/ICETOOL 6
No new posts first column truncated in search result IBM Tools 13
Search our Forums:

Back to Top