View previous topic :: View next topic
|
Author |
Message |
vab987
New User
Joined: 01 Dec 2006 Posts: 29 Location: S.A
|
|
|
|
Hi,
What does W00-Null-Ind tells in this Select querry.
W00-NULL-IND variable is of S9(4), initialized as 0.
Querry is :
EXEC SQL
SELECT CUST_ACNT_N
,CLOSD_D
,CENT_FULL_IBT_N
INTO :DCLACNT.CUST-ACNT-N
,:DCLACNT.CLOSD-D:W00-NULL-IND
,:CENT-FULL-IBT-N
FROM IBIS.CUST_ACNT
,IBIS.CENTRE
WHERE CUST_ACNT_N = :DCLACNT.CUST-ACNT-N
AND CENTR_N = CENT_CENTR_N
WITH UR
END-EXEC
I am unable to understand why this W00-NULL-IND is used ??
Thanks, |
|
Back to top |
|
|
ashwinreddy
Active User
Joined: 16 Sep 2004 Posts: 106 Location: Hyderabad
|
|
|
|
Hi,
If a column is Not null and the null indicator will have the information as whether the column has some data or it is null.
In your case you select that indictor values into your variable W00-NULL-IND.
Depending upon the value you will populate the values in DCLACNT.CLOSD-D.
As if W00-NULL-IND = 0
we assume that the column contains some value.
If you doesn't handle the null indicator you will get -305 (as you might be aware)
Cheers
Ashwin |
|
Back to top |
|
|
vab987
New User
Joined: 01 Dec 2006 Posts: 29 Location: S.A
|
|
|
|
Hi Ashwin,
Thanks a lot.... but couldn't understand abt Handling null indicator.
Do u man that if we don't check the Null indicator (whether it contains zeros or some value ), we will get some error ?
Thanks in advance
Vab |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
On data that may be NULLed, you must check the null indicator to see if you have data before using it. Only when there actually is data should you use the data.
If you use the data and there was none (i.e. it was null), your results may vary (anything from incorrect processing to an abend). |
|
Back to top |
|
|
|