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

How can you find out which query is taking lot of time to execute in cobol-db2 program ?

1 Answers   Danske,


Outputs of explain are with matchcols = 0. What does this signify?

0 Answers  


What does a deadlock mean in DB2?

0 Answers  


What is db2 isolation?

2 Answers  


How does cobol compile db2 program?

0 Answers  






What are the uses of db2 optimizer?

0 Answers  


is it possible to get -811 error when you use cursors. why?

2 Answers   IBM,


select distinct(empid),distinct(dept),name from EMP will the above query work?

2 Answers   CTS,


On which levels locks can be applied?

0 Answers  


How do you do the EXPLAIN of a dynamic SQL statement?

2 Answers  


Can DASD types assigned to storage groups be intermixed (i.e., 3350s and 3380s)?

1 Answers  


What is table space in db2?

0 Answers  


Categories