Steve
You could set your cursor while loops as
Make sure your SET/DEFINE all our variables outside the while loops.
SET VAR VIdNumber INTEGER
SET VAR VLastName TEXT
DROP CURSOR C1
DECL C1 CURSOR FOR SEL idnumber FROM sometable
OPE C1
--While for c1
WHILE 1 = 1 THEN
FETCH C1 INTO Vidnumber INDIC IVIdnumber
IF SQLCODE = 100 THEN
BREAK
ENDIF
DROP CURSOR C2
DECL C2 CURSOR FOR SEL columnlist FROM sometable whe idnumber =
.vidnumber
OPE C2
--While for c2
WHILE 2 = 2 THEN
FETCH C2 INTO ....
IF SQLCODE = 100 THEN
BREAK
ENDIF
--EndWhile for c2
ENDWHILE
DROP CURSOR C2
--EndWhile for c1
ENDWHILE
DROP CURSOR C1
Buddy
-----Original Message-----
From: J. Stephen Wills [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 27, 2002 1:47 PM
To: [EMAIL PROTECTED]
Subject: Cursor-In-A-Cursor ...
I have a situation where, at least f/now, it seems best to CURSOR into one
table, then, f/ea record, CURSOR into another table f/matching records. My
problem is managing SQLCODE values. Is it possible to use something other
than ...
WHILE SQLCODE <> 100 THEN
...
ENDWHILE
That is, could I set a variable equal to SQLCODE at the appropriate points,
such as after a FETCH, and test that variable?
Thanks,
Steve in Memphis
================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: INTRO rbase-l
================================================
TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: UNSUBSCRIBE rbase-l
================================================
TO SEARCH ARCHIVES:
http://www.mail-archive.com/rbase-l%40sonetmail.com/
================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: INTRO rbase-l
================================================
TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: UNSUBSCRIBE rbase-l
================================================
TO SEARCH ARCHIVES:
http://www.mail-archive.com/rbase-l%40sonetmail.com/