I have a multi-schema oracle DB in which client account should be varchar(50) in all the schemas. Therefore, I'd like to assign a new name to varchar(50) like MYCLIENT such that in all table, sp and functions, I simply use MYCLIENT to define a field, parameter, etc. to avoid misintegrity.
1 - How should I define the new type in Oracle (The simplest method)
2 - Where to define it (Schema, package, DB, ..) in accordance to the best practices?
Thanks a lot
I'm afraid there's no simple way to achieve this. You could define a subtype inside a package like this:
SUBTYPE myclient is VARCHAR2(50);
but you would not be able to use this as a type for database column. In order to do so, you would have to define a SQL type with:
CREATE TYPE myclient ...
but you are only able to define record types, object types or collection types this way. This is weird, but well, just as quite a few things in Oracle... :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With