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


Please Help Members By Posting Answers For Below Questions

What is view db2?

626


What is rebind in db2?

576


What is the use of db2 optimizer?

613


How to check table size in db2 sap?

583


How to get the ddl of a table in db2?

679






What is image copy in db2?

576


What is collection in db2 bind?

579


What is a page in db2?

615


What are the full forms of spufi and dclgen and why are they used?

660


What language is db2 written in?

597


What is check constraint in db2?

611


What is cursor stability in db2?

813


Explain db2.

621


What is query_cache_limit?

549


What is cloudant database?

647