12.07.2015 Views

Oracle SQL Developer

Oracle SQL Developer

Oracle SQL Developer

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Setting up the Globalization Support EnvironmentTreatment of letter accents also differs among languages. For example, in Danish, Æ issorted after Z, while Y and Ü are considered to be variants of the same letter.You can define how to sort data by using linguistic sort parameters. The basiclinguistic definition treats strings as sequences of independent characters.This topic includes the following topics:■ NLS_SORT■ NLS_COMP11.2.8.1 NLS_SORTThe NLS_SORT parameter specifies the collating sequence for ORDER BY queries. Itoverrides the default NLS_SORT value that is derived from NLS_LANGUAGE. The valueof NLS_SORT can be BINARY or any valid linguistic sort name:NLS_SORT = BINARY | sort_nameIf the value is BINARY, then the collating sequence is based on the numeric code of thecharacters in the underlying encoding scheme. Depending on the data type, this willeither be in the binary sequence order of the database character set or the nationalcharacter set. If the value is a named linguistic sort, sorting is based on the order of thedefined sort. Most, but not all, languages supported by the NLS_LANGUAGE parameteralso support a linguistic sort with the same name.You can set the NLS_SORT parameter to change the linguistic sorting behavior of theyour <strong>SQL</strong> session. Spain traditionally treats ch, ll as well as ñ as letters of their own,ordered after c, l and n respectively. Example 11–11 and Example 11–12 illustrate theeffect of using a Spanish sort against the employee names Chen and Chung. InExample 11–11, the NLS_SORT parameter is set to BINARY.In Example 11–11, LIKE is used to specify the records to return with the query. Forinformation on LIKE, see Restricting Data Using the WHERE Clause.Example 11–11Setting NLS_SORT to BINARY-- set the NLS_SORT for this user sessionALTER SESSION SET NLS_SORT=binary;-- select the last name of those employees whose last name begin with CSELECT last_name FROM employeesWHERE last_name LIKE 'C%' ORDER BY last_name;The output of Example 11–11 appears:LAST_NAME--------------CabrioCambraultCambraultChenChungColmenaresIn Example 11–12, the NLS_SORT parameter is set to SPANISH_M.Example 11–12 Setting NLS_SORT to Spanish-- set the NLS_SORT for this user sessionALTER SESSION SET NLS_SORT=spanish_m;Working in a Global Environment 11-15

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!