Skip to content

Common Data Type in Oracle for reusability

I have data type with fixed column data type and size. For example,

If you see above I have CREATE_USER char(36) in almost all tables. I want to make it replaceable. So that in future I can change the type/size. For example, I call it CREATE_USER myDataType, so that in future I need to replace it only one place. Is it possible in Oracle?

Advertisement

Answer

Have a look at the following example; that’s how I understood the question.

Type first:

Table whose column’s datatype is my_type

Let’s insert some rows:

OK, the 2nd one doesn’t fit. Let’s make it larger (the type, I mean):

How about now?

Seems to be OK.

User contributions licensed under: CC BY-SA
5 People found this is helpful