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

What is the difference between oracle and db2?

587


How to find the number of rows in a db2 table?

644


How can you count the number of rows from a table tab?

639


What is null in db2?

575


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

688






Are view updateable?

631


What is bind in db2?

608


What are bind parameters in db2?

613


What is a buffer in memory?

601


What is db2?

743


Name the various locking levels available?

638


What is schema in db2?

576


What type of database is db2?

527


what are bind concepts in db2 cobol?

653


In an sql table that is embedded, what is the procedure to retrieve rows that are part of a db2 table?

646