Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: beginner: cursors
Mr.Baha wrote:
> On Apr 10, 10:15 am, DA Morgan <damor..._at_psoug.org> wrote:
>> matt wrote: >>> On Apr 10, 1:41 am, "dombrooks" <dombro..._at_hotmail.com> wrote: >>>> Replace 'DECLARE' with 'CREATE OR REPLACE PROCEDURE <your_proc_name> >>>> AS' >>>> and you're pretty much done. >>> I attempted to do this and receive a Procedure Created with >>> Compilation Errors. >>> Here is what I altered from the initial post above: >>> CREATE OR REPLACE PROCEDURE sp_seniority( >>> name OUT empbb02.ename%TYPE, >>> seniority OUT number, >>> TYPE cursor_var IS REF CURSOR, >>> myCursorVar OUT cursor_var;) AS >>> BEGIN >>> Does that TYPE cursor_var also need to be specified as an OUT? >> CREATE OR REPLACE TYPE or declare it in a package header. >> >> Look at these examples:http://www.psoug.org/reference/ref_cursors.html >> -- >> Daniel A. Morgan >> University of Washington >> damor..._at_x.washington.edu >> (replace x with u to respond) >> Puget Sound Oracle Users Groupwww.psoug.org
The above code example is a horror story with so many things wrong I'm not sure where to start.
I would suggest pushing back away from the keyboard and getting both Tom Kyte's books and a class in beginning PL/SQL. The c.d.o. groups are not an on-line tutorial.
On your list of things to learn should be the following syntax: OPEN <refcursor> FOR
-- Daniel A. Morgan University of Washington damorgan_at_x.washington.edu (replace x with u to respond) Puget Sound Oracle Users Group www.psoug.orgReceived on Tue Apr 10 2007 - 14:51:23 CDT