|
Hello again, in my opinion the problem is that a procedure is stoped the first time the END; command occurs. See this little example with only one while-loop and a simple insert-statement following: CREATE DBPROC TEST
AS
VAR var1 INTEGER; var2 CHAR(100)
SELECT VAR1, VAR2 FROM TABLE1;
WHILE $rc = 0 DO BEGIN
FETCH INTO :var1, :var2;
INSERT INTO TABLE2 (a,b) Values (:var1, :var2);
END;
INSERT INTO TABLE2 (a,b) Values (99, 'this insert statement will never happen!!!');If you call the procedure the while loop will be correctly executed. But you will not get a result from the second insert statement. Seems to me that the END; command terminates the hole procedure. Therefore it is not possible to nest more than one loop, or to chain one after another. Please correct my if i'm wrong (and i hope so). Regards Andreas Zabach, Elke schrieb: Michael Comanns wrote: -- Andreas Ackermann Institute for Experimental and Clinical Pharmacology and Toxicology, Friedrich-Alexander University of Erlangen Fahrstrasse 17 D-91054 Erlangen Tel. +-49-9131-8522-968 Fax +-49-9131-8522-236 e-mail: [EMAIL PROTECTED] |
- nested while statements / nested loops Andreas Ackermann
- RE: nested while statements / nested loops Dittmar, Daniel
- nested while statements / nested loops Michael Comanns
- RE: nested while statements / nested loops Zabach, Elke
- Re: nested while statements / nested loops Andreas Ackermann
- Re: nested while statements / nested loops Michael Slinn
- RE: nested while statements / nested loops Neal, John
- RE: nested while statements / nested loops Zabach, Elke
- RE: nested while statements / nested loops Zabach, Elke
- RE: nested while statements / nested loops Michael Slinn
