| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle Stored Procedure Troubleshooting
The show errors would be more useful, but
one thing I see is you declared the cursor and
"numresult" AFTER the "begin" statement in the body
of your procedure. I suspect you'll want to
move that between the "IS" and the "BEGIN".
Like so:
> CREATE OR REPLACE PACKAGE BODY DRGIUTIL
> AS
> PROCEDURE drgisearch(docnumber IN VARCHAR2,
> volume OUT tbl_volume,
> section OUT tbl_section,
> issue OUT tbl_issue,
> change OUT tbl_change,
> sheet OUT tbl_sheet,
> path OUT tbl_path )
> IS
> CURSOR drgicursor
> IS
> -- do query here
> SELECT VOLUME, SECTION, ISSUE, CHANGE, SHEET, PATH
> FROM DRGI_SHEETS
> WHERE DOCUMENT_ID LIKE '%docnumber%';
> numresult NUMBER DEFAULT 1;
> BEGIN
>> END DRGIUTIL;
> -- loop through assigning values
> FOR C IN drgicursor LOOP
> volume (numresult) := C.VOLUME;
> section (numresult) := C.SECTION;
> issue (numresult) := C.ISSUE;
> change (numresult) := C.CHANGE;
> sheet (numresult) := C.SHEET;
> path (numresult) := C.PATH;
>
> -- increment number of results
> numresult := numresult + 1;
> END LOOP;
>
> END drgicursor;
"Mark" <mfaine_at_knology.net> wrote in message
news:329dd608.0212030700.6c4a1974_at_posting.google.com...
> I'm trying to create a stored procedure on an Oracle 7.3.2.1.0 Server.
> I am accessing this server via SQL Plus. I'm not sure that it makes
> any difference but I am accessing this server through a link from an
> Oracle 8.1.7 Server.
>> SQL*Plus: Release 8.1.7.0.0 - Production on Tue Dec 3 08:46:20 2002
> -------------------------
>
> >
>
> --------------------------
>
>
>
>
>
>
> __________________________________________________________________
> >
>
> PROCEDURE drgisearch(docnumber IN VARCHAR2,
> volume OUT tbl_volume,
> section OUT tbl_section,
> issue OUT tbl_issue,
> change OUT tbl_change,
> sheet OUT tbl_sheet,
> path OUT tbl_path );
>
> > >
>> END DRGIUTIL;
> -- loop through assigning values
> FOR C IN drgicursor LOOP
> volume (numresult) := C.VOLUME;
> section (numresult) := C.SECTION;
> issue (numresult) := C.ISSUE;
> change (numresult) := C.CHANGE;
> sheet (numresult) := C.SHEET;
> path (numresult) := C.PATH;
>
> -- increment number of results
> numresult := numresult + 1;
> END LOOP;
>
> END drgicursor;
![]() |
![]() |