Why doesn't LIMIT collection method work on Associative Array Index by String
Hi Tom, Need your help. I searched about the error but couldn't find anything about it. Below is the snippet from Oracle's Database PL/SQL Language Reference: "LIMIT is a function that returns the maximum number of elements that the collection can have. If the collection has no maximum number of elements, LIMIT returns NULL. Only a varray has a maximum size." <b>Test code:</b> In the following code block, the LIMIT collection method works only when "typ_associative_array" is INDEX BY PLS_INTEGER (or BINARY_INTEGER) but doesn't when INDEX BY <string-data-type> say VARCHAR2(10) or STRING(10). <code> DECLARE TYPE typ_associative_array IS TABLE OF DATE INDEX BY VARCHAR2(10); v_typ_associative_array typ_associative_array; BEGIN DBMS_OUTPUT.PUT_LINE(NVL(TO_CHAR(v_typ_associative_array.LIMIT),'Collection''s limit is Undefined')); END; / </code> <b>Output:</b> Error report - ORA-06550: line 5, column 62: PLS-00306: wrong number or types of arguments in call to 'LIMIT' ORA-06550: line 5, column 5: PL/SQL: Statement ignored 06550. 00000 - "line %s, column %s:\n%s" *Cause: Usually a PL/SQL compilation error.
Why doesn't LIMIT collection method work on Associative Array Index by String