In a package, I have:
- A Type of Table of Numbers
- A Function that takes said Table of Numbers type as a parameter
- A Procedure that needs to call said Function using Table of Numbers type
I know the Type works, I know the Function works. But when I try to call the Function within the Procedure, I get the following Compilation errors:
Error(262,16): PLS-00306: wrong number or types of arguments in call to '[FUNCTION]' Error(262,16): PL/SQL: ORA-00904: "[PACKAGE]"."[FUNCTION]": invalid identifier Error(264,41): PLS-00642: local collection types not allowed in SQL statements
Package Header:
CREATE OR REPLACE PACKAGE [PACKAGE] AS
TYPE NUMBER_LIST IS TABLE OF NUMBER;
FUNCTION [FUNCTION] (
[LIST_PARAM] NUMBER_LIST
) RETURN VARCHAR2;
PROCEDURE [PROCEDURE] (
RECORDS_AFFECTED OUT NUMBER
);
END [PACKAGE];
Problem Code:
PROCEDURE [PROCEDURE](
RECORDS_AFFECTED OUT NUMBER
)AS
[ID_LIST] NUMBER_LIST;
BEGIN
...
SELECT [COLUMN]
BULK COLLECT INTO [ID_LIST]
FROM [TABLE]
INSERT INTO [TABLE]( [COLUMN] )
SELECT [FUNCTION]( LIST_PARAM => [ID_LIST] )
FROM [OTHER TABLE];
...
END [PROCEDURE];
And the error revolves around this line:
SELECT [FUNCTION]( LIST_PARAM => [ID_LIST] )
I have tried:
[ID_LIST] NUMBER_LIST;
[ID_LIST] [PACKAGE].NUMBER_LIST;
SELECT [FUNCTION]( [ID_LIST] )
SELECT [FUNCTION]( LIST_PARAM => [ID_LIST] )
SELECT [PACKAGE].[FUNCTION]( [ID_LIST] )
SELECT [PACKAGE].[FUNCTION]( LIST_PARAM => [ID_LIST] )
But I feel like the problem is in the way the [ID_LIST] is being passed.
Any thoughts on what I'm doing wrong passing this Type TABLE OF NUMBER parameter to the function?