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 the difference between db2 and oracle?
Give the COBOL definition of a VARCHAR field.
What is the usage of open cursor command?
How to take backup of table in db2?
How can you find out the # of rows updated after an update statement?
When one binds a PACKAGE ( of a plan ) what package information is stored and where it is stored?
What is the difference between CS and RR isolation levels?
what is cursor stability?
What is UNION,UNION ALL?
What is reorg in database?
What is a dbrm in db2?
How can you count the number of rows from a table tab?