Re: PL/SQL "table" question...
Date: 1997/05/23
Message-ID: <3384f258.3686350_at_newshost>#1/1
On 22 May 1997 14:36:46 GMT, ranga_at_shell.one.net (Ranganathan Chakravarthi) wrote:
>Vijay Damodaran (vijayd_at_nortel.com) wrote:
>:
>: When I try to execute this script, I get the following error:
>:
>: ORA-06550: line 6, column 10:
>: PLS-00382: expression is of wrong type
>: ORA-06550: line 7, column 50:
>: PLS-00487: Invalid reference to variable 'ADM'
>:
>
>I tried the same thing and got the same error. I came to a conclusion
>that tables cannot be passed as parameters to functions/procedures.
>I might be wrong. Let me know if you find an answer.
>TIA,
>
They absolutely can. You must consistently use the SAME type tho. for example,
give a package spec:
create or replace package types
as
type myArray is table of varchar2(30) index by binary_integer;
procedure some_proc( x in myArray );
end type;
/
Then:
declare
x types.myArray;
type myArray is table of varchar2(30) index by binary_integer;
y myArray;
begin
types.some_proc( x ); -- Is correct and will work. types.myArray types.some_proc( y ); -- is INCORRECT. myArray is not the same -- as types.myArrayend;
/
>-- Ranga
>--------------------------------------------------------------------------------
> If it doesn't work, don't worry; if it did, you are out of a job!
>--------------------------------------------------------------------------------
>Ranga Chakravarthi e-mail: ranga_at_one.net
>--------------------------------------------------------------------------------
Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Bethesda MD
http://govt.us.oracle.com/ -- downloadable utilities
Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Fri May 23 1997 - 00:00:00 CEST