the Oracle database stores all numbers in the same internal format. As a
developer, you may define numeric values in your applications with all sorts of numeric characteristics,
such as DECIMAL, INT, or SMALLINT, but the storage of those values is limited by the data types of the
columns in the database.
NUMBERThe NUMBER data type is the basic numeric data type used in the Oracle database. Data with this data
type is stored with up to 38 digits of precision. You can specify the precision and the scale of a NUMBER
column with the syntax:
NUMBER(p,s)
where p is the precision of the column and s is the scale of the column. p can be any number up to 38.
The s variable can be either positive, which indicates the number of digits to the right of the decimal
point that will be stored, or negative, which will round the number up by the number of places to the
left of the decimal point. If you do not define a scale, the scale is assumed to be 0. The following table
shows the effect of precision and scale on a value.
No comments:
Post a Comment