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.

Answers were Sorted based on User's Feedback



in the CURSOR declare statement, if i am using an where clause and trying to compare the value with..

Answer / 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

in the CURSOR declare statement, if i am using an where clause and trying to compare the value with..

Answer / nagendra

before open cursor we can populate that value
ex move 1220 to adb-dept

Is This Answer Correct ?    2 Yes 1 No

Post New Answer

More DB2 Interview Questions

What is the difference between primary key & unique index ?

6 Answers   Patni, Temenos,


What are iseries servers?

0 Answers  


While unloading huge amount of data from table. Suddenly job failed some error. Imagine 1M data unloading, In that 90% data unloaded only 10% left, So if want to unload the rest 10% what needs to be done? Whether do i need to start from top or anything ?

0 Answers   JPMorgan Chase,


In which column of which DB2 catalog would you find the length of the rows for all tables?

2 Answers  


What are the different types of base tables?

0 Answers  






What is a clustered index?

1 Answers  


What is the role of the data page in the db2 database?

0 Answers  


Under what circumstances will DB2 allow an SQL statement to update more than one primary key value at a time?

1 Answers  


What is a collection?

3 Answers  


what will be the output of the below given query, if no matching records are found : (a.) 0 (b.) null (c.) error select Avg(salary) from TableA where Deptno = 'insurance'

10 Answers   Amdocs,


What is meant by isolation level?

3 Answers  


What is a db2 cursor?

0 Answers  


Categories