I am trying to create an associative array in Oracle, when I create a nested table, it works fine:
CREATE OR REPLACE TYPE TRNG_BOOK_AUTHORS_TAB
AS TABLE OF VARCHAR2(500);
But when I add the index I get errors:
CREATE OR REPLACE TYPE TRNG_BOOK_AUTHORS_TAB
AS TABLE OF VARCHAR2(500) INDEX BY PLS_INTEGER;
- Error: PL/SQL: Compilation unit analysis terminated
- Error(2,4): PLS-00355: use of pl/sql table not allowed in this context
What do I have wrong?