Hitachi

Hitachi Advanced Database SQL Reference


8.2.4 ATAN2

Returns the angle (in radians) that is the inverse tangent of y/x, in the range -[Figure] to [Figure].

In the specification format, y is set to target-data-1, x is set to target-data-2, and the quadrant in which the value of the execution result falls is determined by the signs of y and x.

Organization of this subsection

(1) Specification format

scalar-function-ATAN2 ::= ATAN2(target-data-1,target-data-2)
 
  target-data-1 ::= value-expression
  target-data-2 ::= value-expression

(2) Explanation of specification format

target-data-1 and target-data-2:

Specifies the numeric data whose inverse tangent of y/x is to be determined.

The following rules apply:

  • Specify target-data-1 and target-data-2 in the form of value expressions. For details about value expressions, see 7.20 Value expression.

  • Specify numeric data for target-data-1 and target-data-2. For details about numeric data, see (1) Numeric data in 6.2.1 List of data types.

  • You cannot specify a dynamic parameter by itself for target-data-1 or target-data-2.

(3) Rules

  1. The data type of the execution result is the DOUBLE PRECISION type.

  2. The NOT NULL constraint does not apply to the value of the execution result (the null value is allowed).

  3. If either target-data-1 or target-data-2 has a null value, the execution result will be a null value.

(4) Example

Example:

Specify the values of columns C1 and C2 from table T1 for target-data-1 and target-data-2, and then determine the inverse tangent of y/x.

SELECT ATAN2("C1","C2") FROM "T1"

[Figure]