Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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!

like image 840
user965422 Avatar asked Mar 12 '26 10:03

user965422


1 Answers

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.

like image 93
APC Avatar answered Mar 14 '26 01:03

APC