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 |
How to check table size in db2 sap?
I have 1000 rows in a db2 table.I want to update first 100 records,How do I do it?
What is the purpose of using commit?
Outputs of explain are with matchcols = 0. What does this signify?
What is the use of value function?
What is copy pending status in db2?
Can a unique index have more than one null value? If not, what error code is given if an attempt is made to insert more than one null value?
If I have 5 Queries in a DB2 Cobol program , while precompiling how many DBRMs will get created and How many Plans and Packages will get created while Bind Process?
explain about index with examples
Is it Possible to read from PS file and write it to database by using dynamic sql(execute immediate)
what are the frequent DB2 abends did you encounter in your programs ?? What are different SQL abends ??
Suppose we have a query for update update table1 set col1 = 'val1' where col2=(select .... from ...) suppose the subquery does not return any record, what will happen to update?