Home » SQL & PL/SQL » SQL & PL/SQL » Using Varrays as Stored Procedure parameter types
Using Varrays as Stored Procedure parameter types [message #8510] Wed, 27 August 2003 05:50 Go to next message
Mark Grimshaw
Messages: 73
Registered: June 2002
Member
All,

I seem to be constantly getting the error PLS 00306 (wrong number or type of arguments) when I try to use a stored procedure in a package from a trigger in another schema.

In essence I am trying to do this: -

-- Function declaration in s.p package
Type MyArrayT Is Varray(100) of varchar2(3);
FUNCTION MyFunction(ArrayParam IN MyArrayT) Return Boolean;

I have a table, lets say called MyTable (in another schema called MySchema) with a column that is also a varray: -

VarrayCol MyArray2T

where MyArray2T is defined as a varray(100) of varchar2(3) - the same as MyArrayT above.

The statement below in a trigger on the table MyTable results in the above error: -

IF MySchema.MyPackage.MyFunction(:new.VArrayCol) THEN ...

Can't seem to spot the problem - can anyone else?

TYIA

Mrk Grimshaw
Re: Using Varrays as Stored Procedure parameter types [message #8518 is a reply to message #8510] Wed, 27 August 2003 16:46 Go to previous message
Barbara Boehmer
Messages: 9090
Registered: November 2002
Location: California, USA
Senior Member
It needs to be the same object type, not just an object type with the same structure, so you will have to change your function declaration to use the MyArray2T from Myschema, instead of MyArrayT:

FUNCTION MyFunction(ArrayParam IN MySchema.MyArray2T) Return Boolean;
Previous Topic: Some Oracle tools
Next Topic: help with copy
Goto Forum:
  


Current Time: Fri Apr 26 23:37:13 CDT 2024