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 authority can be granted to group of users using the GRANT stmt? A) SYSCTRL B) SYSADM C) DBCTRL D) DB ADM
How to define the data items to receive the fetch items for the SQL?
is it possible to get -811 error when you use cursors. why?
What is difference between rollback and commit?
How to find schema of a table in db2?
Describe the elements of the SELECT query syntax?
Explain the use of the WHERE clause?
How to find last record before record through SQLRPGLE?
How would one remove old reorg information from the DB2 catalog?
What does the RUNSTATS Utility do?
db2 query I have one table with the following details. SNO SNAME DOJ ------ -------------------- ---------- 10 KRISH 2007-03-19 20 REDDY 2007-05-19 30 RRRRR 2007-05-19 40 BBBBB 2008-05-19 50 CCCCC 2009-05-19 60 JJJJJ 2009-05-19 70 JJJJJ 2004-05-19 i want the output in the following format:( no of students joined in each year(no nedd to consider about month and date) year count --------- ---------- 2004 1 2007 3 2008 1 2009 2
My SQL is not performing well. Describe how will you fine tune it?