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?
Answers were Sorted based on User's Feedback
Answer / 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 |
What's the maximum number of characters that a tablename can have?
What is a view? Why use it?
where will u check for sqlcode ?
what is dynamic cursor?gives syntax for this?
What is the meaning of -805 SQL return code?
what types of copies can be made with the COPY Utility ?
How do you prepare a COBOL + DB2 program from coading till execution ?
What is a page?
What is cursor stability in db2?
How do I add a column in db2?
How is the SUBSTR keyword used in sql?
what is a collection?