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 |
Which are the db2 tools to protect integrity of the database?
What is sqlca?
Why do we need to create an alias if we can directly use the table name? What are the benefits of referring a table name by its alias? Also, when should we go for alias and when for synonyms?
What is the COBOL picture clause for a DB2 column defined as DECIMAL(11,2)?
I am having n number of records in a table which consists of emp-name is one of the field among them. Now i want to change the first letter of every name with capital.
How will you return the number of records in table?
What are union and union all?
What is a clustering index?
What are the contents of a dclmgen?
What is database alias db2?
What is a Resource Control Table(RCT)? Describe its characteristics.
What is the difference between cursor and select statement?