- wrote:
in this case the code's data type is permanently 2 char long but for
other fields, it would be easier if i just put '...%TYPE' so that if the
original field changes, i do not have to change the other fields that
refer to it.
There's nothing like that which I would know.
I got only something like 3 years of work experience in building
databases, but I have never even thought that I could have a problem
like that. Do you really change the column types in your database so
often that you really need to worry about this? Do you really have so
many references to other column types that you couldn't do that manually
if you need to change it?
If I have a reference to other table, I always use int unsigned -type. I
have never had a need to change it. Normal columns that haven't been a
reference to anywhere, sometimes need the change, but in those cases the
%TYPE wouldn't help.