Suppose the outcome of executing a query results in a row
having null. Based on the answer how you use it? Its
declaration and inclusion?
Answer Posted / mani
While declaring the cursor include the null indicator for
the variables which you are retrieiving from the table.
Example.
Select empno,deptname from emp into
:ws-empno:ws-empno-ind,:ws-deptname:ws-deptname-ind
where empname='....'
Based on the values in ws-empno-ind,ws-deptname-ind we can
know whether the vaules being retrived are null are not.
If null indicator variable has a value -1 then the retrieved
value is null.
If you do no specify null indicator variable and the value
retreived is null then you would get -305 as the sqlcode.
The null indicator is declared as
05 ws-empno-ind s9(4) comp
| Is This Answer Correct ? | 22 Yes | 0 No |
Post New Answer View All Answers
What is cursor with hold option in db2?
What is db2 purescale?
What is table space in db2?
How do you select a row using indexes in db2?
What is a dbrm in db2?
Which isolation level provides highest data integrity?
What is universal database?
What does db2 blu stand for?
What is the advantage in De-normalizing tables in DB2?
What is meant by dclgen?
Explain in brief how does db2 determine what lock-size to use?
What is lock escalation in db2?
Why cursor is used in db2?
What is db2 bind process?
Explain how can you do the explain of a dynamic sql statement?