|
Deb
Not sure what kind
of problem you are having but....
Unless you really
want the cursor to move forward and backward, I would omit "SCROLL"
Remove the "WHERE
CURRENT OF c1" from DECLARE .....
DECLARE ......
WHERE COMIS IS NOT NULL
My own
preference would be
IF .fnegcom = 'T' THEN
SET VAR negcomis CURR SET VAR negshrs INT SET VAR vShares REAL (or whatever the datatype
is)
SET
VAR VComis CURR (again whatever the datatype is)
DECLARE CURSOR c1 SCROLL CURSOR FOR SELECT SHARES, COMIS FROM EQUIT + WHERE COMIS IS NOT NULL
OPEN CURSOR
c1
FETCH LAST FROM EQUIT INTO negshrs INDICATOR vinegshrs, + tmrate INDICATOR vitmrate WHILE SQLCODE <> 100
THEN
IF tmrate IS NOT NULL THEN SET VAR negcomis = (.tmrate * .negshrs) UPDATE
EQUIT SET whatcolumn = .negcomis WHERE CURRENT OF
C1
ENDIF FETCH LAST FROM EQUIT INTO negshrs INDICATOR vinegshrs, + tmrate INDICATOR vitmrate ENDWHILE
DROP CURSOR c1
ENDIF Buddy From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Deb Roepken Sent: Monday, May 09, 2005 1:32 PM To: RBG7-L Mailing List Subject: [RBG7-L] - Declare Cursor question Hi-
Can someone tell me what I'm doing wrong
here?
IF .fnegcom = 'T' THEN
SET VAR negcomis CURR SET VAR negshrs INT DECLARE CURSOR c1 SCROLL CURSOR FOR SELECT SHARES, COMIS FROM EQUIT + WHERE CURRENT OF
c1
OPEN CURSOR c1 FETCH LAST FROM EQUIT INTO negshrs INDICATOR vinegshrs, + tmrate INDICATOR vitmrate IF SQLCODE = 0 THEN IF tmrate IS NOT NULL THEN SET VAR negcomis = .tmrate * .negshrs ENDIF ENDIF ENDIF CLOSE c1 DROP CURSOR c1 Thanks, all comments are appreciated.
Deb Roepken
|
<<Glacier Bkgrd.jpg>>
