Oracle-Supported Functions

This section provides an alphabetical listing of the SQL functions specific to Oracle, with examples and corresponding results.

ACOS(number)

Returns the arccosine of number ranging from −1 to 1. The result ranges from 0 to π and is expressed in radians. For example:

SELECT ACOS( 0 ) FROM DUAL -> 1.570796
ADD_MONTHS(date, int)

Returns the date plus int months. For example:

SELECT ADD_MONTHS('15-APR-1999', 3) FROM DUAL -> 15-JUL-99
APPENDCHILDXML(xml_fragment, xpath, value[, namespace])

Injects value into the XML fragment xml_fragment at the location specified by the XPath expression xpath and returns the result. The optional namespace argument provides the namespace information for the XPath expression. For example:

SELECT APPENDCHILDXML('<a><b>B</b></a>', '/a', '<c>C</c>') FROM DUAL
'<a><b>B</b><c>C</c></a>'
ASCII(text)

Returns the ASCII code of the first character of text. For example:

SELECT ASCII('x') FROM DUAL -> 120
ASCIISTR(text)

Converts text from any character set into an ASCII equivalent. Characters in text that have no equivalent in ASCII will be replaced with the string \XXXX, where XXXX represents the UTF-16 code unit. For example:

SELECT ASCIISTR('ÄBC') FROM DUAL -> '\00C4BC'
ASIN(number)

Returns the arcsine 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 ) FROM DUAL -> 0.000000
ATAN(number)

Returns the arctangent of any number. The resulting value ranges from -π/2 to π/2 and ...

Get SQL in a Nutshell, 3rd 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.