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

Home -> Community -> Usenet -> c.d.o.misc -> Why no implicit cursors ? (was Re: Problem with PL/SQL / nextval)

Why no implicit cursors ? (was Re: Problem with PL/SQL / nextval)

From: Marc <E.Mail_at_address.com>
Date: Fri, 20 Aug 1999 07:38:17 +0200
Message-ID: <7pipov$6h8$1@vkhdsu24.hda.hydro.com>

I've already heard different times that an implicit cursor should not be used in PL/SQL, but noone can give me a good reason. I heard that implicit cursors are slower : I tested it, and it appeared that explicit cursors are slower, even if only one row is returned ! Someone else told that implicit cursors are never closed : I tested it, and that is not true either (IMO explicit cursors have a higher risk of not being closed)...

So, why should I avoid 'select ... into ..' in PL/SQL ?

(I performed the tests on Oracle 7.3.3)

Marc

Ron Reidy wrote in message <37BBF555.3DBF1A41_at_uswest.net>...
>Niklas Mehner wrote:
>
>
>This is a PL/SQL issue. PL/SQL always executes a SELECT ... INTO twice
>in order to throw this exception. To repevent this, create an explicit
>cursor for the query, open it, fetech from it, and close it.
>
>Some advice on PL/SQL...
>
>1. NEVER use implcit cursors for queries.
>2. ALWAYS put an exception handler in your code
>3. ALWAYS close your cursor before the PL/SQL program unit completes
>(both in the body of the code and the exception handlers).
>
>
>--
>Ron Reidy
>Oracle DBA
>Reidy Consulting, L.L.C.
>
>
Received on Fri Aug 20 1999 - 00:38:17 CDT

Original text of this message

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