Oracle Error PLS-00540: object not supported in this context.

Oracle Error Message

PLS-00540: object not supported in this context.

Reason for the Error

An object was declared inside a local scope (Function, Procedure, or anonymous block), or in a package scope which is not supported.

Solution

Declare the type in a global or data base scope.