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

NLS_CHARSET_ID

Examples

The following example returns the number of characters that are in a 200-byte column when you are using a multibyte character set:

SELECT NLS_CHARSET_DECL_LEN

(200, nls_charset_id(’ja16eucfixed’)) FROM DUAL;

NLS_CHARSET_DECL_LEN(200,NLS_CHARSET_ID(’JA16EUCFIXED’))

--------------------------------------------------------

100

NLS_CHARSET_ID

Syntax nls_charset_id::=

NLS_CHARSET_ID ( text )

Purpose

NLS_CHARSET_ID returns the character set ID number corresponding to character set name text. The text argument is a run-time VARCHAR2 value. The text value ’CHAR_CS’ returns the database character set ID number of the server. The text value ’NCHAR_CS’ returns the national character set ID number of the server.

Invalid character set names return null.

Examples

The following example returns the character set ID of a character set:

SELECT NLS_CHARSET_ID(’ja16euc’)

FROM DUAL;

NLS_CHARSET_ID(’JA16EUC’)

-------------------------

830

See Also: Oracle9i Database Globalization Support Guide for a list of character set names

Functions 6-103

NLS_CHARSET_NAME

NLS_CHARSET_NAME

Syntax nls_charset_name::=

NLS_CHARSET_NAME ( number )

Purpose

NLS_CHARSET_NAME returns the name of the character set corresponding to ID number number. The character set name is returned as a VARCHAR2 value in the database character set.

If number is not recognized as a valid character set ID, then this function returns null.

Examples

The following example returns the chartacter set corresponding to character set ID number 2:

SELECT NLS_CHARSET_NAME(2)

FROM DUAL;

NLS_CH

------

WE8DEC

See Also: Oracle9i Database Globalization Support Guide for a list of character set IDs

NLS_INITCAP

Syntax nls_initcap::=

 

 

,

nlsparam

NLS_INITCAP

(

char

 

 

)

6-104 Oracle9i SQL Reference

NLS_INITCAP

Purpose

NLS_INITCAP returns char, with the first letter of each word in uppercase, all other letters in lowercase. Words are delimited by white space or characters that are not alphanumeric.

Both char and ’nlsparam’ can be any of the datatypes CHAR, VARCHAR2, NCHAR, or NVARCHAR2. The string returned is of VARCHAR2 datatype and is in the same character set as char.

The value of ’nlsparam’ can have this form:

’NLS_SORT = sort’

where sort is either a linguistic sort sequence or BINARY. The linguistic sort sequence handles special linguistic requirements for case conversions. These requirements can result in a return value of a different length than the char. If you omit ’nlsparam’, then this function uses the default sort sequence for your session.

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 examples show how the linguistic sort sequence results in a different return value from the function:

SELECT NLS_INITCAP

(’ijsland’) "InitCap" FROM DUAL;

InitCap

-------

Ijsland

SELECT NLS_INITCAP

(’ijsland’, ’NLS_SORT = XDutch’) "InitCap" FROM DUAL;

InitCap

-------

IJsland

Functions 6-105

NLS_LOWER

See Also: Oracle9i Database Globalization Support Guide for information on sort sequences

NLS_LOWER

Syntax nls_lower::=

 

 

,

nlsparam

NLS_LOWER

(

char

 

 

)

Purpose

NLS_LOWER returns char, with all letters lowercase.

Both char and ’nlsparam’ can be any of the datatypes CHAR, VARCHAR2, NCHAR, NVARCHAR2, CLOB, or NCLOB. The string returned is of VARCHAR2 datatype and is in the same character set as char.

The ’nlsparam’ can have the same form and serve the same purpose as in the

NLS_INITCAP function.

Examples

The following statement returns the character string ’citta’’ using the XGerman linguistic sort sequence:

SELECT NLS_LOWER

(’CITTA’’’, ’NLS_SORT = XGerman’) "Lowercase" FROM DUAL;

Lowerc

------

citta’

6-106 Oracle9i SQL Reference

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