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
can any one provide me the link for the db2 v7 & db2 v8 manual for Z/os? i need to know about the syntax of REORG in both versions & need to know the difference as well
Mention the different locking levels that are available in db2.
What is explain in db2?
How can we read records for specific member in CL? AND rpg?
How can you classify the locks in db2?
How to run db2 command in windows?
Define declaration generator (dclgen).
Where can you declare a cursor in a cobol-db2 program?
Can you use max on a char column?
What is host variable?
Where do you specify them?
What is lock escalation in db2?
How will you return the number of records in table?
How do I import a csv file into db2?
What is dclgen in db2?