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
Hi, i would like to start a new carrier in DB2 DBA.Which and what all step should i have to take..?
What does a deadlock mean in DB2?
Define predicate?
What types of tables are there in the db2 database?
Who uses db2?
What is the purpose of rollback and commit?
List out the buffer pools in db2
Is ibm db2 free?
What is meant by dclgen?
What is syscat in db2?
Mention the definition of cobol in varchar field.
Why do we bind in db2?
What is db2 command?
What are the uses of db2 optimizer?
by using cursors , we can access particular records from the table based on some condition, i want to delete those selected records, how can we write a query for this in the program?