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 format (internal layout) of ?TIMESTAMP??

1 Answers  


Explain about open switch business continuity software?

0 Answers  


How does DB2 determine what lock-size to use?

2 Answers  


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

0 Answers  


what is differnece between DROP TABLE & DELETE TABLE .

4 Answers   Cap Gemini,


What do you mean by NOT NULL WITH DEFAULT? When will you use it?

3 Answers  


if any of the column names is provided wrong, where do you get the error(during precompilation or during Bind)

3 Answers  


What is buffrpool? Where we use it ?

2 Answers   Tesco,


What is cascading rollback?

0 Answers  


What are the contents of a dclmgen?

0 Answers  


What is dynamic SQL?

1 Answers   ADP,


What is a trigger in the db2 database?

0 Answers  


Categories