Definition:
In Oracle PL/SQL, SQRT is a built in function which returns the square root of a numeric input. It returns positive output if the input argument is a number. For negative input arguments, it raises ORA-01428 exception.
Example Syntax:
SQRT(x)
Example Usage:
The SQL below shows that SQRT function raises exception when used with negative number.
SQL> select sqrt(-3) from dual;
select sqrt(-3) from dual
*
ERROR at line 1:
ORA-01428: argument '-3' is out of range
The SQL statement below returns the square root of 3.
SQL> SELECT SQRT(3) FROM DUAL;
SQRT(3)
----------
1.73205081
Related Links: