SQRT scalar function
The SQRT function returns the square root of the argument.
The schema is SYSIBM.
The argument must be an expression that returns the value of any built-in numeric data type. If the argument is DECFLOAT, the operation is performed in DECFLOAT. Otherwise, the argument is converted to a double precision floating-point number for processing by the functions.
The argument can also be a character string or graphic string data type. The string input is implicitly cast to a numeric value of DECFLOAT(34).
If the argument is DECFLOAT(n), the result is DECFLOAT(n). Otherwise, the result of the function is a double precision floating-point number. If the argument is a special decimal floating point value, the general rules for arithmetic operations apply. For more information, see General arithmetic operation rules for DECFLOAT
The result can be null; if the argument is null, the result is the null value.
SELECT SQRT(:SQUARE)
FROM SYSIBM.SYSDUMMY1;
This example returns a double
precision floating-point number with an approximate value of 3.