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 statistic will tell the DBA how must space can be reclaimed from dropped table spaces on the next reorg run?

1 Answers  


How can you do the explain of a dynamic sql statement?

0 Answers  


How Plan is created while executing the query using SPUFI?

3 Answers  


What is the use of with ur in db2?

0 Answers  


What are the 2 sqlcodes that are returned?

0 Answers  






What is a db2 table?

0 Answers  


Is ibm db2 free?

0 Answers  


How to see the structure of db2 table??

4 Answers   IBM,


Request to database but database is not available so what is was abend is raised?

2 Answers   UST,


What is db2 catalog database?

0 Answers  


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

0 Answers  


What is meant by dclgen?

0 Answers  


Categories