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
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 |
What is dbrm? What it contains?
How do you simulate the EXPLAIN of an embedded SQL statement in SPUFI/QMF? Give an example with a host variable in WHERE clause)
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?
How to check sequence on a table in db2?
What are foreign keys in db2?
what are the frequent DB2 abends did you encounter in your programs ?? What are different SQL abends ??
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.
Which command is used to remove all rows from a table?
Where is the output of EXPLAIN stored?
Explain dclgen.
Can we update view in db2?
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?