ravi.bollineni
New User
Joined: 28 Jun 2006 Posts: 8
|
|
|
|
Hi All,
I am working on mainframe environment using the Database as DB2. Following is the declaration of my cursor.
| Code: |
EXEC SQL
DECLARE CNTRPT CURSOR FOR
SELECT DEPT_ID,
DEPT_GRP_NBR
CASE DEPT_STAT_CDE
WHEN 10 THEN SET :WS-PAID-CNT = COUNT(*)
WHEN 11 THEN SET :WS-ADJ-CNT = COUNT(*)
END
FROM DEPT_DTL
WHERE DEPT_DTL.CUST_ID = :PARM-CUST AND
DEPT_DTL.TRNS_CDE = 'P'
GROUP BY DEPT_ID,
DEPT_GRP_NBRR,
DEPT_AFFL_ID
ORDER BY DEPT_ID,
DEPT_GRP_NBRR
END-EXEC. |
***********************************************************
While fetching data from the cursor can i use the following way?
| Code: |
EXEC SQL
FETCH CNTRPT
INTO :DB-NF-DEPT_ID,
:DB-NF-DEPT_GRP_NBR,
:DB-NF-PAID-CNT,
:DB-NF-ADJ-CNT
END-EXEC |
Can i retrieve the data of the variable :WS-PAID-CNT into
DB-NF-PAID-CNT?
Could you please calrify me in this regard.
Thanks,
Ravi. |
|