SQL Guide : Data types : Numeric data types
  
Numeric data types
Data type
Size
Precision
Scale
Length
Display Size
TINYINT
[-128, 255]
3
0
1 (bytes)
4 (signed) 3 (unsigned)
SMALLINT
[-32768, 65535]
5
0
2 (bytes)
6 (signed) 5 (unsigned)
INTEGER INT
[-231, 231- 1]
10
0
4 (bytes)
11 (signed) 10 (unsigned)
BIGINT
[-263, 263- 1]
19
0
8 (bytes)
20 (signed)
REAL
Positive numbers:
1.175494351e-38 to
1.7014117e+38
Negative numbers:
-1.7014117e+38 to
-1.175494351e-38
You can also use value zero (0) with this data type.
7
N/A
4 (bytes)
13
FLOAT
Positive numbers:
2.2250738585072014e-308 -
8.98846567431157854e+307
Negative numbers:
-8.98846567431157854e+307 to
-2.2250738585072014e-308
You can also use value zero (0) with this data type.
15
N/A
8 (bytes)
22
DOUBLE PRECISION
Positive numbers:
2.2250738585072014e-308 -
8.98846567431157854e+307
Negative numbers:
-8.98846567431157854e+307 to
-2.2250738585072014e-308
You can also use value zero (0) with this data type.
15
N/A
8 (bytes)
22
DECIMAL1
±1.0e254
DEFPREC Max 52 Default 52
DEFSCALE1
Default 0
2-27 (bytes)
Variable
NUMERIC2
±1.0e254
DEFPREC Max 52 Default 52
DEFSCALE2
Default 2 or 0
2-27 (bytes)
Variable
Note [1] The default value of scale (DEFSCALE) for the DECIMAL data type depends on whether precision (DEFPREC) is specified:
If precision is not specified, the DECIMAL values are represented as (exact) decimal floating point numbers of precision 52 and range ±1.0e254.
If precision is specified, the default scale is 0.
Also, the precision of DECIMAL is always 52. The maximum value is 52.
DECIMAL = DECIMAL(52,floating point) DECIMAL(prec) = DECIMAL(52,0) DECIMAL(prec,scale) = DECIMAL(52,scale)
The default value of scale (DEFSCALE) for the NUMERIC data type depends on whether precision (DEFPREC) is specified: If precision is not specified, the default scale is 2.
If precision is specified, the default scale) is 0.
NUMERIC = NUMERIC(52,2) NUMERIC(prec) = NUMERIC(prec,0) NUMERIC(prec,scale) = NUMERIC(prec,scale)
Notes
Although integer data types (TINYINT, SMALLINT, INT, and BIGINT) can be interpreted by the client program as either signed or unsigned, solidDB® stores and orders them as signed integers. There is no way to tell the server to order the integer data types as though they were unsigned.
BIGINT has approximately 19 significant digits. This means that you can lose the least significant digits when storing BIGINT into non-integer data types such as FLOAT (approximately 15 significant digits), SMALLFLOAT (approximately 7 significant digits), DECIMAL (16 significant digits).
See also
Data types