Can anyone clarify what datatype NUMBER(12,0)
means in S_NO NUMBER(12,0) NOT NULL ENABLE PRIMARY KEY
?
Please clarify each parameter (i.e. 12,0
).
Can anyone clarify what datatype NUMBER(12,0)
means in S_NO NUMBER(12,0) NOT NULL ENABLE PRIMARY KEY
?
Please clarify each parameter (i.e. 12,0
).
NUMBER(12,0)
indicates a numeric data type with precision 12
and scale 0
.
A related SO post explains precision and scale further:
Precision is the number of significant digits. Oracle guarantees the portability of numbers with precision ranging from 1 to 38.
Scale is the number of digits to the right (positive) or left (negative) of the decimal point. The scale can range from -84 to 127.
Applying this explanation to your case, the maximum number that NUMBER(12,0)
could store would be 999999999999
(i.e. 12 significant digits with no digits to the right or left of the decimal point).
There are many other supporting explanations of Oracle's numeric data types, precision, and scale online too, including a good one from Oracle FAQ.