DB2-Supported Extensions
This section provides an alphabetical listing of DB2-supported functions that are specific to DB2 and not from the ANSI standard, with examples and corresponding results.
-
ABSVAL(
number
) Synonym for ABS(
number
). For example:VALUES( ABSVAL( -1 ) )
-> 1-
ACOS(
number
) Returns the arc cosine of a number ranging from -1 to 1. The result ranges from 0 to and is expressed in radians. For example:
SELECT ACOS( 0 )
-> 1.570796-
ASCII(
text
) Returns the ASCII code of the first character of text. For example:
SELECT ASCII('x')
-> 120-
ASIN(
number
) Returns the arc sine of
number
ranging from -1 to 1. The resulting value ranges from -/2 to /2 and is expressed in radians. For example:SELECT ASIN( 0 )
-> 0.000000-
ATAN(
number
) Returns the arctangent of any
number
. The resulting value ranges from -/2 to /2 and is expressed in radians. For example:
SELECT ATAN( 3.1415 )
-> 1.262619
-
ATAN2(
number
,nbr
) Returns the arctangent of
number
andnbr
. The values fornumber
andnbr
are not restricted, but the results range from - to and are expressed in radians. ATAN2(x
,y
) is similar to ATAN(y
/x
) with the exception that the signs ofx
andy
are used to determine the quadrant of the result. For example:VALUES( ATAN2( 3.1415, 1 ) )
-> +3.08177595443792E-001-
ATANH(
number
) Returns the hyperbolic arctangent of
number
. The values fornumber
are not restricted, but the results range from - to and are expressed in radians. For example:VALUES( ATANH( 0 ) )
-> +0.00000000000000E+000 ...
Get SQL in a Nutshell, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.