user965422
user965422

Reputation: 87

CAST to package type

Is it possible to CAST to a type within a package? For example:

CAST(v_variable AS Mypackage.type)

I know CAST states the ability to cast to built-in types but I was wondering if this was possible. I'm interested in this approach because I prefer keeping my utilities in one package instead of having a separate TYPE object.

Thanks!

Upvotes: 3

Views: 442

Answers (1)

APC
APC

Reputation: 146239

No. CAST() is a SQL function so we can only use it with SQL types. This means we cannot use it with types we have declared in a PL/SQL package.

Upvotes: 5

Related Questions