ORA-21700: object does not exist or is marked for delete for Associative Array as input parameter called from ODP.NET

前端 未结 1 1934
花落未央
花落未央 2020-12-18 10:23

I have this package code on Oracle 12c

CREATE OR REPLACE PACKAGE Support_Data_Types AS
  TYPE ttDate            IS TABLE OF DATE  
END Support_Data_Types;

P         


        
相关标签:
1条回答
  • 2020-12-18 10:32

    after several days of googling, I changed the code this way:

    CREATE OR REPLACE PACKAGE Support_Data_Types AS
                TYPE ttDate            IS TABLE OF DATE
    END Support_Data_Types;
    PROCEDURE GetData
    (
        tabDates IN SUPPORT_DATA_TYPES.TTDATE,
    )
    AS
        v_temp SUPPORT_DATA_TYPES.TTDATE:= tabDates;  -- assigned the parameter to a temporary variable
    BEGIN
        SELECT count(*) INTO n FROM table(v_temp);
    END GetData;
    

    the only thing I did is to use a v_temp which looks quite redundant. but it works. I made this change because I searched this article here ... it mentioned:

    Note, however, that as of 12.1, you cannot call the table function directly inside the TABLE operator. You must invoke it in PL/SQL, assign result to a variable, and then reference the variable inside TABLE.

    though the situation is different in my case (I m using 12.2), it solved my problem.

    0 讨论(0)
提交回复
热议问题