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 -> Re: working with PL/SQL REF CURSORs

Re: working with PL/SQL REF CURSORs

From: Vladimir M. Zakharychev <bob_at_dpsp-yes.com>
Date: Tue, 29 Oct 2002 15:55:34 +0300
Message-ID: <apm0ks$lcu$1@babylon.agtel.net>


A few suggestions:

  1. do not assign io_cursor to v_cursor, open io_cursor directly for that statement.
  2. To get to the cursor data in PL/SQL, you use FETCH statement, usually in a loop, like this:

LOOP
FETCH cursor_var INTO <list of variables to receive cursor columns>; EXIT WHEN cursor_var%NOTFOUND;
-- process the row here

END LOOP; 3) If possible, use strong ref cursors (REF CURSORs without RETURN clause are known as 'weak' ref cursors because their row type is not known at compile time, and figuring it out at run time is not trivial in PL/SQL.) to avoid runtime ROWTYPE_MISMATCH exceptions.

For more information on cursors and cursor variables, please read PL/SQL Developer's Guide (Interaction with Oracle chapter).

--

Vladimir Zakharychev (bob@dpsp-yes.com)                http://www.dpsp-yes.com
Dynamic PSP(tm) - the first true RAD toolkit for Oracle-based internet applications. All opinions are mine and do not necessarily go in line with those of my employer. Received on Tue Oct 29 2002 - 06:55:34 CST

Original text of this message

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