ASIN() Function in Oracle

In Oracle, the ASIN() function returns the arcsine (inverse sine) of its argument.

In other words, it returns the value whose sine is the argument.

Syntax

The syntax goes like this:

ASIN(n)

Where n is a valid expression that resolves to a number between -1 and 1.

Example

Here’s an example:

SELECT ASIN(0.7130)
FROM DUAL;

Result:

                                 ASIN(0.7130) 
_____________________________________________ 
   0.7937675542241276685031867479973723291388

Out of Range Argument

The argument must be between -1 and 1. If it’s outside of that range, an error is returned.

Example:

SELECT ASIN(2)
FROM DUAL;

Result:

Error starting at line : 1 in command -
SELECT ASIN(2)
FROM DUAL
Error report -
ORA-01428: argument '2' is out of range

Non-Numeric Argument

The argument can be any numeric data type or any nonnumeric data type that can be implicitly converted to a numeric data type.

Here’s what happens when we provide a non-numeric argument that can’t be converted to a numeric data type:

SELECT ASIN('One')
FROM DUAL;

Result:

Error starting at line : 1 in command -
SELECT ASIN('One')
FROM DUAL
Error report -
ORA-01722: invalid number

Null Values

Passing null to ASIN() returns null:

SET NULL 'null';

SELECT ASIN(null)
FROM DUAL;

Result:

   ASIN(NULL) 
_____________ 
         null

By default, SQLcl and SQL*Plus return a blank space whenever null occurs as a result of a SQL SELECT statement.

However, you can use SET NULL to specify a different string to be returned. Here I specified that the string null should be returned.

Incorrect Argument Count

Calling ASIN() without passing any arguments returns an error:

SELECT ASIN()
FROM DUAL;

Result:

Error starting at line : 1 in command -
SELECT ASIN()
FROM DUAL
Error at Command Line : 1 Column : 8
Error report -
SQL Error: ORA-00909: invalid number of arguments
00909. 00000 -  "invalid number of arguments"
*Cause:    
*Action:

And passing the wrong number of arguments results in an error:

SELECT ASIN(1, 2)
FROM DUAL;

Result:

Error starting at line : 1 in command -
SELECT ASIN(1, 2)
FROM DUAL
Error at Command Line : 1 Column : 8
Error report -
SQL Error: ORA-00909: invalid number of arguments
00909. 00000 -  "invalid number of arguments"
*Cause:    
*Action: