> maybe someone can help me with my problem.
> I'm trying to chain more than one while-statement, but it won't work.
[...]
>    SELECT VAR1, VAR2 FROM TABLE1;
>     WHILE $rc = 0 DO BEGIN
>           FETCH INTO :var1, :var2;
>       SELECT VAR3 FROM TABLE2 WHERE VAR1 = :var1;
>         WHILE $rc = 0 DO BEGIN
>                FETCH INTO :var3;
>           insert into TABLE3 (a,b,c) Values (:var1, :var2, :var3);
>         END;
>     END;

If you want to iterate through more than one cursor at a time, you'll have to name 
them. See DECLARE CURSOR on how to name them and FETCH <result_table_name> on how to 
access them.

Daniel Dittmar

-- 
Daniel Dittmar
SAP DB, SAP Labs Berlin
[EMAIL PROTECTED]
http://www.sapdb.org/
_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to