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 -> Re: PL/SQL Parameter arrays

Re: PL/SQL Parameter arrays

From: Vladimir M. Zakharychev <bob_at_dpsp-yes.com>
Date: Mon, 1 Jul 2002 14:58:27 +0400
Message-ID: <afpckq$r0l$1@babylon.agtel.net>


Types of formal and actual parameters must match exactly. From Oracle's point of view, your str_array and num_array declared inline in anonymous block are NOT the same types as those you used to declare the stored procedure, even though they seem logically identical. You should use either global or packaged types when declaring both formal and actual parameters, like this:

create or replace package remote_pipe
as

type str_array is table of varchar2(255) index by binary_integer; type num_array is table of number(9) index by binary_integer;

procedure pr_proc(....)

end;

and you call it like this:

declare

   saEncoderType REMOTE_PIPE.str_array;
   naRank REMOTE_PIPE.num_array;
....

hth.

-- 
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.


"Noodles" <noodles_at_aol.com> wrote in message news:20020629200458.09222.00001027_at_mb-cb.aol.com...

> HP Unix 11
> Oracle 8.1.7
>
> I'm a relative newbie am trying to get a 2 returned arrays ( one is varchar and
> one is number) from a procedure call back into local variable types.
>
> I've tried "typing" my variable using a PL/SQL table but it still gives me a
> type mismatch. Am I missing something? The code is below...
>
> Note: sa prefix = String array
> na prefix = Number array
>
> {Code}
> /*---------------------------------------------
> set serveroutput on size 1000000;
> declare
>
> type str_array is table of varchar2(255) index by binary_integer;
> type num_array is table of number(9) index by binary_integer;
>
> mycount number;
> sToEncode varchar2(200);
> sDictionary varchar2(200);
> nErrNum number;
> sErrMsg varchar2(200);
> nEncoderCount number;
> saEncoderType str_array;
> naRank num_array;
> naMatch num_array;
> saRetEncoder str_array;
> saTermInfo str_array;
>
> begin
> sToEncode := 'test_stroke';
> sDictionary := test_dict1';
>
> remote_pipe.pr_proc(sToEncode,
> sDictionary,
> nErrNum,
> sErrMsg,
> nEncoderCount,
> saEncoderType,
> naRank,
> naMatch,
> saRetEncoder,
> saTermIfo);
>
> exception
> when others then
> dbms_output.put_line(sqlerrm);
> end;
> /
> /*---------------------------------------------
>
> TIA,
> Cliff
Received on Mon Jul 01 2002 - 05:58:27 CDT

Original text of this message

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