Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Semestr2 / 1 - Oracle / Oracle selected docs / SQL reference.pdf
Скачиваний:
24
Добавлен:
12.05.2015
Размер:
11.92 Mб
Скачать

ACOS

Alphabetical Listing of SQL Functions

ABS

Syntax abs::=

ABS ( n )

Purpose

ABS returns the absolute value of n.

Examples

The following example returns the absolute value of -15:

SELECT ABS(-15) "Absolute" FROM DUAL;

Absolute

----------

15

ACOS

Syntax acos::=

ACOS ( n )

Purpose

ACOS returns the arc cosine of n. The argument n must be in the range of -1 to 1, and the function returns values in the range of 0 to π, expressed in radians.

Examples

The following example returns the arc cosine of .3:

SELECT ACOS(.3)"Arc_Cosine" FROM DUAL;

Functions 6-17

ADD_MONTHS

Arc_Cosine

----------

1.26610367

ADD_MONTHS

Syntax add_months::=

ADD_MONTHS ( d , n )

Purpose

ADD_MONTHS returns the date d plus n months. The argument n can be any integer. If d is the last day of the month or if the resulting month has fewer days than the day component of d, then the result is the last day of the resulting month. Otherwise, the result has the same day component as d.

Examples

The following example returns the month after the hire_date in the sample table employees:

SELECT TO_CHAR( ADD_MONTHS(hire_date,1), ’DD-MON-YYYY’) "Next month" FROM employees

WHERE last_name = ’Baer’;

Next Month

-----------

07-JUL-1994

ASCII

Syntax ascii::=

ASCII ( char )

6-18 Oracle9i SQL Reference

ASCIISTR

Purpose

ASCII returns the decimal representation in the database character set of the first character of char.

char can be of datatype CHAR, VARCHAR2, NCHAR, or NVARCHAR2. The value returned is of datatype NUMBER. If your database character set is 7-bit ASCII, then this function returns an ASCII value. If your database character set is EBCDIC Code, then this function returns an EBCDIC value. There is no corresponding EBCDIC character function.

Note: This function does not support CLOB data directly. However, CLOBs can be passed in as arguments through implicit data conversion. Please refer to "Datatype Comparison Rules" on page 2-45 for more information.

Examples

The following example returns the ASCII decimal equivalent of the letter Q:

SELECT ASCII(’Q’) FROM DUAL;

ASCII(’Q’)

----------

81

ASCIISTR

Syntax asciistr::=

ASCIISTR ( string )

Purpose

ASCIISTR takes as its argument a string in any character set and returns an ASCII string in the database character set. The value returned contains only characters that appear in SQL, plus the forward slash (/). Non-ASCII characters are converted to their Unicode (UTF-16) binary code value.

Functions 6-19

ASIN

See Also: Oracle9i Database Globalization Support Guide for information on Unicode character sets and character semantics

Examples

The following example returns the ASCII string equivalent of the text string "ABÄCDE":

SELECT ASCIISTR(’ABÄCDE’) FROM DUAL;

ASCIIS

------

ABDCDE

ASIN

Syntax asin::=

ASIN ( n )

Purpose

ASIN returns the arc sine of n. The argument n must be in the range of -1 to 1, and the function returns values in the range of -π/2 to π/2 and are expressed in radians.

Examples

The following example returns the arc sine of .3:

SELECT ASIN(.3) "Arc_Sine" FROM DUAL;

Arc_Sine

----------

.304692654

6-20 Oracle9i SQL Reference

Соседние файлы в папке Oracle selected docs