DOUBLE_PRECISION or DOUBLE
The DOUBLE_PRECISION and DOUBLE functions returns a floating-point representation of either a number or a character-string or graphic-string representation of a number, an integer, a decimal number, or a floating-point number.
Numeric to Double:
>>-+-DOUBLE_PRECISION-+-(numeric-expression)------------------->< '-DOUBLE-----------'
String to Double:
>>-+-DOUBLE_PRECISION-+-(string-expression)-------------------->< '-DOUBLE-----------'
The schema is SYSIBM.
Numeric to Double
- numeric-expression
- An expression that returns a value of any built-in numeric data
type.
The result is the same number that would occur if the expression were assigned to a double precision floating-point column or variable.
String to Double
- string-expression
- An expression that returns a value of a character
or graphic string (except a CLOB or DBCLOB) with a length attribute
that is not greater than 255 bytes. The string must contain a valid
string representation of a number.
The result is the same number that would result from CAST(string-expression AS DOUBLE PRECISION). Leading and trailing blanks are removed from the string, and the resulting substring must conform to the rules for forming a valid string representation of an SQL floating-point, integer, or decimal constant.
The result of the function is a double precision floating-point number.
The result can be null; if the argument is null, the result is the null value.
FLOAT can be specified as a synonym for DOUBLE or DOUBLE_PRECISION.
SELECT EMPNO, DOUBLE(SALARY)/COMM
FROM DSN8A10.EMP
WHERE COMM > 0;