Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Passing pl/sql table as parameter problems
admiral_freebee_at_hotmail.com (Hervé Ferreira) wrote in message news:<ca41e26c.0305120017.15230f6c_at_posting.google.com>...
> Hi,
>
> I've written a procedure that returns a pl/sql table as an
> outputparameter. In the procedure in which I call this procedure I
> want to store the table in a local pl/sql table. But I keep getting
> the following compilation error:
>
> 'Compilation errors for PACKAGE BODY EVAP.PCK_208E2_TEST
>
> Error: PLS-00306: wrong number or types of arguments in call to
> procedure 'BAR_LEEFTIJD'.
> Line: 130
> Text: PCK_208E2_BAREMA.bar_leeftijd(P_BAR_CODE => baremac,
> P_AANTAL_UREN => to_number(t_type_uur), P_DTVAN => v_datum, P_DTTOT =>
> ttot, P_BAR_KLASSE_CODE => klassecode, P_TYPE_LOON => typel,
> P_LEEFTIJD => leeftijd,'
>
> Originally I thought the problem was a type mismatch between the local
> pl/sql table and the type of the one I return from the procedure, but
> that doesn't seem to be the case.
>
> any suggestions would be very welcome.
You can not use structural matching for pl/sql tables (or associative array). Full name of the type must be used when delcaring variables. That means use types created in SQL or within the package.
Package created.
SQL> create or replace package body my_pkg as
2 procedure proc1(in_tab in pkg_tab_typ) is
3 x pkg_tab_typ;
4 begin
5 x:=in_tab;
6 dbms_output.put_line('first element: '||x(1)||' 2nd element:
'||x(2)); 7 end; 8 end;
Package body created.
PL/SQL procedure successfully completed.
SQL>
Type created.
SQL> create or replace procedure my_proc(in_tab in sql_tab_typ) as
2 begin
3 dbms_output.put_line('1st: '||in_tab(1)||' , 2nd: '||in_tab(2));
4 end;
5 /
Procedure created.
PL/SQL procedure successfully completed.
SQL>