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 the function of logging in the db2 database?
How do I add a column in db2?
What is the reason behind not using select * in embedded sql programs?
What is cursor stability in db2?
What is db2 plan table?
What language is db2 written in?
What does runstats do in db2?
Where can you declare a cursor in a cobol-db2 program?
What is a plan and package in db2?
Following a db2 update statement, what is the quickest way to compute the total number of updated rows?
If the cursor is kept open followed the issuing of commit, what is the procedure to leave the cursor that way?
What is the role of the data page in the db2 database?
How to find the number of rows in db2 tables?
What is sqlca?
Define data page.