Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> PL/SQL: defining default value for table type
Hi,
supposingly I have the following package which defines one type:
CREATE OR REPLACE PACKAGE p1 IS
TYPE t_array IS TABLE OF VARCHAR2(30) INDEX BY BINARY_INTEGER;
END;
If I then create another package which should use this table type in a
procedure called 'result' I'm temted to write:
CREATE OR REPLACE PACKAGE p2 IS
PROCEDURE result(array p1.t_array DEFAULT p1.t_array);
END;
But his gives me the error:
2/3 PL/SQL: Declaration ignored 2/48 PLS-00330: invalid use of type name or subtype name
On the net I found a solution that suggested to create the package 'p2' in the following way:
CREATE OR REPLACE PACKAGE p2 IS
empty_array p1.t_array;
PROCEDURE result(array p1.t_array DEFAULT empty_array);
END;
And now I'm wondering how I possibly could solve the issue when I want to
use the table type 't_array' in a procedure:
CREATE OR REPLACE PROCEDURE proc1
(
array p1.t_array DEFAULT p1.t_array
)
AS
BEGIN
NULL;
END;
That gives me again the above error. I think I'm looking for a way to
instantiate an empty object of type t_array to use for the DEAULT clause.
Thx.
-- Matthias Wirtz - Norfolk, USAReceived on Sat Jul 16 2005 - 19:19:07 CDT