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
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 |
Answer / nagendra
before open cursor we can populate that value
ex move 1220 to adb-dept
Is This Answer Correct ? | 2 Yes | 1 No |
What is the difference between primary key & unique index ?
What are iseries servers?
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 ?
In which column of which DB2 catalog would you find the length of the rows for all tables?
What are the different types of base tables?
What is a clustered index?
What is the role of the data page in the db2 database?
Under what circumstances will DB2 allow an SQL statement to update more than one primary key value at a time?
What is a collection?
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'
What is meant by isolation level?
What is a db2 cursor?