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

DB2 NULL VALUE


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
nidhi.palsule

New User


Joined: 17 Feb 2009
Posts: 9
Location: Pune

PostPosted: Wed Jun 02, 2010 6:19 pm
Reply with quote

Hi,

My problem is that DB2 is not populating null value to host variable, but its only setting its indicator variable to -1. I have never noticed such a case. For eg:

SALARY is null for one particular row. When I fetch this row, indicator variable for salary is set to -1 but the host variable :Salary still contains the old value from previous fetch.

Does this happen with DB2, or I am missing something here?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Jun 02, 2010 6:25 pm
Reply with quote

Quote:
Does this happen with DB2


yes that is the way is happens.

with what would you expect db2 to populate :Salary?

the fact that the column is null indicates that there is no value associated with this column.
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 Jun 02, 2010 8:36 pm
Reply with quote

Hello,

Quote:
DB2 is not populating null value to host variable
Because there is no such thing as a "null value" in db2. . .

NULL is a condition not a value. One byte may contain a value from x'00' to x'FF' and none of these is a "null value". All 256 are valid non-null values. . .
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 -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts Null values are considered in Total c... DFSORT/ICETOOL 6
No new posts the system or user abend SF0F R=NULL COBOL Programming 0
No new posts Uploading from desktop, a CSV file, s... DB2 2
No new posts How to handle NULL in COBOL program COBOL Programming 8
No new posts Change NULL indicator in UNLOAD utility DB2 2
Search our Forums:

Back to Top