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



Suppose the outcome of executing a query results in a row having null. Based on the answer how you..

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

Suppose the outcome of executing a query results in a row having null. Based on the answer how you..

Answer / keshireddy

Perfect

Is This Answer Correct ?    3 Yes 1 No

Post New Answer

More DB2 Interview Questions

What is the clustering index in the db2 database?

0 Answers  


How does DB2 store NULL physically?

2 Answers  


How connect db2 database to datastage?

0 Answers  


In a single table,How to retrieve a employee-id of an employee who works in more than one department?

15 Answers   Cap Gemini,


what is the steps followed in EXPLAIN Process or EXPLAIN command. (Explain is for identifying the optimized access path but how or what is the steps for doing the EXPLAIN)

4 Answers   IBM,


How to check table size in db2 sap?

0 Answers  


PLAN IS EXECUTABLE AND PACKAGE IS NOT EXECUTABLE . THEN WHAT IS THE USE OF PACKAGE?

2 Answers   Tech Mahindra, Wipro,


What is the difference between base table and view?

7 Answers  


Mention and explain the contention situations caused by locks?

1 Answers  


What is an intent lock?

3 Answers  


What is image copy?

1 Answers   Virtusa,


What do you mean by cursor?

0 Answers  


Categories