Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Interesting PL/SQL question

Interesting PL/SQL question

From: Brad Worsfold <bworsfold_at_vic.lgs.ca>
Date: 1997/11/25
Message-ID: <01bcf9c3$5a34f410$0faf22cf@cerulean>#1/1

IF a person was to use a cursor with a FOR LOOP would the language be smart enough to close the cursor in the following statement? I am just looking for
some data that uses a UNION statement. If it is found, it is inside a function and it
will return false to the calling procedure.

    FOR rec IN CSR_CLIENTS LOOP
      RETURN FALSE;
    END LOOP; I know that this will work, but I am wondering if it will clean up after itself? Otherwise, I could
set a flag, and issue a statement like this:

    FOR rec IN CSR_CLIENTS LOOP

      bFound := TRUE;
      EXIT;

    END LOOP;        IF bFound THEN
      RETURN FALSE;
    END IF; Which is better? The first one looks nicer, however, does it clean up after itself????

I am curious as to what everyone thinks,

Brad Received on Tue Nov 25 1997 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US