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


Please Help Members By Posting Answers For Below Questions

File not opened because library is *PROD and debug is UPDPROD(*NO). ? what may be the reason? how to solve it..?

2375


How to check last update on table in db2?

626


Which component is used to execute the sql statements?

619


What is package in db2 mainframe?

555


What is a db2 table?

595






Are views updateable?

642


What is the syntax for creating a table in the db2 database?

626


How is deadlock resolved?

648


How many types of page locks can be held in db2?

589


For a db2 column that is being defined as decimal (11, 2), discuss the cobol picture clause.

658


Explain in detail about buffer manager and its functionalities?

562


What is check constraint in db2?

603


What is the difference between cursor stability and repeatable read isolation levels?

678


Define check constraint.

642


What is runstats and reorg in db2?

791