O'Reilly logo

SQL in a Nutshell by Kevin Kline

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 and nbr. The values for number and nbr 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 of x and y 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 for number are not restricted, but the results range from - to and are expressed in radians. For example:

VALUES( ATANH( 0 ) )        -> +0.00000000000000E+000 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required