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 dbrm? What it contains?

0 Answers  


How do you simulate the EXPLAIN of an embedded SQL statement in SPUFI/QMF? Give an example with a host variable in WHERE clause)

2 Answers  


A Table feild is declared as Decimal(7,2). I want to insert the decimal in to this column thru cobol-db2 program. How should I declare my local input file variable or any suggestion?

7 Answers   IBM,


How to check sequence on a table in db2?

0 Answers  


What are foreign keys in db2?

0 Answers  


what are the frequent DB2 abends did you encounter in your programs ?? What are different SQL abends ??

4 Answers   Xansa,


What is an EXPLAIN in DB2. How and what is the steps followed in EXPLAIN command. Can all the queries be used in EXPLAIN command to check the performance.

3 Answers   IBM,


Which command is used to remove all rows from a table?

0 Answers  


Where is the output of EXPLAIN stored?

2 Answers  


Explain dclgen.

0 Answers  


Can we update view in db2?

0 Answers  


Suppose I have a program which uses a dynamic SQL and it has been performing well till now. Off late, I find that the performance has deteriorated. What happened?

1 Answers  


Categories