in the CURSOR declare statement, if i am using an where
clause and trying to compare the value with a host-varialble.
EXEC SQL DECLARE C1 CURSOR FOR
SELECT DEPTNO, DEPTNAME, MGRNO
FROM DEPARTMENT
WHERE ADMRDEPT = :ADM-DEPT
Where would i need to provide value to this host-variable in
the where clause. how could i pass value to this
host-variable to check it.
Answers were Sorted based on User's Feedback
Before opening this cursor thru OPEN <cursor_name>. because
when we open the cursor, it fetches all matching records
from table and stores them in buffer. so it evaluates that
where clause while opening the cursor.
| Is This Answer Correct ? | 8 Yes | 1 No |
Answer / nagendra
before open cursor we can populate that value
ex move 1220 to adb-dept
| Is This Answer Correct ? | 2 Yes | 1 No |
what is REORG? what is the use?
Is DECLARE TABLE in DCLGEN necessary? Why it used?
Explain how can you do the explain of a dynamic sql statement?
WHAT IS NULL INDICATOR ? WERE IS THIS USED? AND IF IT IS USED IN FILES CONCEPT? HOW DO WE USE IT?
Can we install 2 different versions of Db2 on same mainframe?
assume ther are 5000 records in a database and want to fetch using cursor. cursor fetches only 3000 records and fetch is not happening for remaining 2000 records. why it happens and how to rectify it
What is a correlated sub query?
What is the physical storage length of time data type?
How to get Top 10 Salaries from a Table
Is it possible to alter a table – for example adding a column, when another user is accessing or updating some columns?
What is the result of open cursor statement?
Can I use LOCK TABLE on a view?