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 are db2 error codes -305 and -407. What is the difference between these 2 error codes ?
What is iseries database?
Can a Db2 table data be retrived through JCL?
Mention a credible reason why select* is never given preference in an sql program that has been embedded.
What is db2 bind?
What is buffer pool and list some of them?
I HAVE 2 TABLES ONE IS EMP_TABLE AND ANOTHER DEPT_TABLE.EMP_TABLE CONTAINS NAME,DEPTNO,DEPTNAME,LOCATION AND DEPT_TABLE CONTAINS DEPTNO,DOJ(DATE OF JOINING).I WANT TO DISPLAY NAME,DEPTNAME,DOJ AND WHO ARE JOINED BETWEN 01- JAN-2007 TO 01-JAN-2008?
How to run db2 command in windows?
Explain packages.
What's the difference between DB2 active log and archive log? Thanks a lot...
What is the difference between "db2ilist" and "db2 get instance" commands in DB2 Database Server?
What is the difference between nvl and coalesce?