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 the difference between nvl and coalesce?
before altering a table is it necessary to lock ? if lock what is it ? how to do ? ifi want to lock a table what is that command ?
What is load utility in db2?
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?
have 3 tables table1, table2 and table3 which contains employee information. table1 is master table, table2 contains emp details like emp no and so on, table 3 contains emp salary. so if any emp leave company between 25th - 30th of every month it has to get updated in tables. but it is not getting updated. What is the reason.
DB2 can implement a join in three ways using a merge join, a nested join or a hybrid join. Explain the differences?
What type of database is db2?
What's The Error Code For Unique Index Voilation?
Comment whether the cursor is closed during commit or not.
How does cobol compile db2 program?
What is precompiler in db2?
How to compare data between two tables in db2?
What is isolation level in db2?
What is cloudant database?
Can you use max on a char column?