View previous topic :: View next topic
|
Author |
Message |
nidhi.palsule
New User
Joined: 17 Feb 2009 Posts: 9 Location: Pune
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
|