Skip to content

G-2210: Avoid declaring NUMBER variables, constants or subtypes with no precision.

Critical

Efficiency

Reason

If you do not specify precision number is defaulted to 38 or the maximum supported by your system, whichever is less. You may well need all this precision, but if you know you do not, you should specify whatever matches your needs. Also, consider using a simpler data type that uses fewer resources, such as pls_integer.

Example (bad)

1
2
3
4
create or replace package types_up is
   subtype salary_type is number;
end types_up;
/

Example (good)

1
2
3
4
create or replace package types_up is
   subtype salary_type is number(5,1);
end types_up;
/