Plymouth Rock
Plymouth Rock

Reputation: 492

Associative array with member function

Can we have member function for an associative array in Oracle?

DECLARE
TYPE country_list IS TABLE OF VARCHAR2(50)
INDEX BY VARCHAR2(5);

and I want to add a member function as to_char() that will print all the items in its own list (just like java toString() for maps/arraylist).

How to do this?

Upvotes: 1

Views: 165

Answers (1)

Wernfried Domscheit
Wernfried Domscheit

Reputation: 59456

You cannot create a member function on an Associative array. This is only possible on OBJECT Types.

You must write the function using the "classic" structured programing.

Upvotes: 1

Related Questions