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.
Answer Posted / mandar panse
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 |
Post New Answer View All Answers
What is universal database?
What is deadlock in db2?
What is multi row fetch in db2?
What is concurrency?
What is blu acceleration in db2?
before altering a table is it necessary to lock ? if lock what is it ? how to do ? ifi want to lock a table what is that command ?
Explain the contention situations caused by locks?
What parameters are used to control the free space in DB2?
Is db2 a database?
What is difference between isnull and coalesce?
I have a subprogram B calling from mainprogram A.I have opened a cursor in A ,Can i fetch the same cursor in subprogram B , If yes , Please explain the reason?
Which is faster delete or truncate?
How do I add a column to a table in db2?
What is the function of logging in the db2 database?
What is sqlca’s maximum length?