Re: ProC Question!

From: Tommy Wareing <p0070621_at_oxford-brookes.ac.uk>
Date: 23 Aug 1993 06:15:05 -0500
Message-ID: <CC7Lu9.C1B_at_uk.ac.brookes>


Dorian Winterfeld (dorian_at_wam.umd.edu) wrote:
> Hello ProC gurus,
> I am a novice ProC programmer and I have a question about
> cursors. Is it possible to open multiple cursors in the same program?
> Either at the same time, by nesting one cursor inside another, or
> consecutively, one after the other. From the manual, the only way
> to 'break out' of a loop is 'WHEN NOT FOUND GOTO..'. This seems very
> limiting as it applies to all SELECT statements. I know that in
> PL/SQL you can refer to a specific cursor, as in 'WHEN cursor%NOTFOND
> GOTO...'. This is much more flexable. Is there a similar trick
> in ProC? Please send replies to:

Personally, I never use WHEN NOT FOUND GOTO anyway, I always use CONTINUE, and then check explicitly for the end of data.  

as in
  EXEC SQL OPEN first;
  while (TRUE) {
    EXEC SQL FETCH first INTO :some_vars;     if (sqlca.sqlcode==1403) break;
    EXEC SQL OPEN second;
    while (TRUE) {

      EXEC SQL FETCH second INTO :more_vars;
      if (sqlca.sqlcode==1403) break;

    }
 EXEC SQL CLOSE second;
  }
  EXEC SQL CLOSE first;

Or whatever...

> dorian_at_eng.umd.edu
 

> thanks in advance,
> Dorian

--
  _________________________   __________________________________________
 /  Tommy Wareing          \ /  In the beginning, there was The Bomb    \
|  p0070621_at_brookes.ac.uk   X   And The Bomb said "Let there be Light!"  |
 \  0865-483389            / \     - The Bomb, Dark Star                /
  ~~~~~~~~~~~~~~~~~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Received on Mon Aug 23 1993 - 13:15:05 CEST

Original text of this message