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 does DB2 use multiple table indexes?

1 Answers  


What is a Foreign Key?

0 Answers   Tavant Technologies, Zensar,


For update of a row in cursors, when do we move value into host variable in cobol progrm? is it before open or before fetch ?

2 Answers   iGate,


What is phantom read in db2?

0 Answers  


Is db2 a programming language?

0 Answers  






Which catalog table stores referential constraints?

1 Answers  


Can DB2 be accessed by TSO users? If yes, which command is used to invoke DB2?

1 Answers  


What is the difference between cursor and select statement?

0 Answers  


what is the total syntax for fetch ? can any one please give me all the details of fetch ? thx

2 Answers   IBM,


How to connect to db2 database from windows command line?

0 Answers  


how to resolve -805. give clear explination for that

2 Answers   IBM,


What is netezza database?

0 Answers  


Categories