Oracle Error PLS-00522: MAP methods must return a scalar type.

Oracle Error Message

PLS-00522: MAP methods must return a scalar type.

Reason for the Error

The MAP member function was written such that it returns something other than a scalar type.

Solution

Rewrite the MAP function such that it returns a scalar type.