An unconstrained numeric column is subject to the limits described in Table 8.2. The maximum precision that can be explicitly specified in a numeric type declaration is 1000. If you're concerned about portability, always specify the precision and scale explicitly.) (The SQL standard requires a default scale of 0, i.e., coercion to integer precision. A column of this kind will not coerce input values to any particular scale, whereas numeric columns with a declared scale will coerce input values to that scale. Without any precision or scale creates an “ unconstrained numeric” column in which numeric values of any length can be stored, up to the implementation limits. The precision must be positive, while the scale may be positive or negative (see below). To declare a column of type numeric use the syntax: Integers can be considered to have a scale of zero.īoth the maximum precision and the maximum scale of a numeric column can be configured. So the number 23.5141 has a precision of 6 and a scale of 4. The scale of a numeric is the count of decimal digits in the fractional part, to the right of the decimal point. We use the following terms below: The precision of a numeric is the total count of significant digits in the whole number, that is, the number of digits to both sides of the decimal point. However, calculations on numeric values are very slow compared to the integer types, or to the floating-point types described in the next section. Calculations with numeric values yield exact results where possible, e.g., addition, subtraction, multiplication. It is especially recommended for storing monetary amounts and other quantities where exactness is required. The type numeric can store numbers with a very large number of digits. The following sections describe the types in detail. The numeric types have a full set of corresponding arithmetic operators and functions. The syntax of constants for the numeric types is described in Section 4.1.2. Up to 131072 digits before the decimal point up to 16383 digits after the decimal point
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |