12.07.2015 Views

Oracle SQL Developer

Oracle SQL Developer

Oracle SQL Developer

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Locale-Dependent <strong>SQL</strong> Functions with Optional NLS ParametersTable 11–5<strong>SQL</strong> FunctionTO_NUMBERTO_CHARTO_NCHARNLS_UPPERNLS_LOWERNLS_INITCAPNLSSORT(Cont.) <strong>SQL</strong> Functions and Their Valid NLS ParametersValid NLS ParametersNLS_NUMERIC_CHARACTERS,NLS_CURRENCY,NLS_DUAL_CURRENCY,NLS_ISO_CURRENCY,NLS_DATE_LANGUAGE,NLS_NUMERIC_CHARACTERS,NLS_CURRENCY,NLS_ISO_CURRENCY,NLS_DUAL_CURRENCY,NLS_CALENDARNLS_DATE_LANGUAGE,NLS_NUMERIC_CHARACTERS,NLS_CURRENCY,NLS_ISO_CURRENCY,NLS_DUAL_CURRENCY,NLS_CALENDARNLS_SORTNLS_SORTNLS_SORTNLS_SORTExample 11–16 illustrates how to use NLS parameters in <strong>SQL</strong> functions.Example 11–16Using NLS Parameters in <strong>SQL</strong> FunctionsSELECT TO_DATE('1-JAN-99', 'DD-MON-YY','NLS_DATE_LANGUAGE = American') "01/01/99" FROM DUAL;SELECT TO_CHAR(hire_date, 'DD/MON/YYYY','NLS_DATE_LANGUAGE = French') "Hire Date" FROM employees;SELECT TO_CHAR(SYSDATE, 'DD/MON/YYYY','NLS_DATE_LANGUAGE = ''Traditional Chinese'' ') "System Date" FROM DUAL;SELECT TO_CHAR(13000, '99G999D99','NLS_NUMERIC_CHARACTERS = '',.''') "13K" FROM DUAL;SELECT TO_CHAR(salary, '99G999D99L', 'NLS_NUMERIC_CHARACTERS = '',.''NLS_CURRENCY = ''EUR''') salary FROM employees;SELECT TO_CHAR(salary, '99G999D99C', 'NLS_NUMERIC_CHARACTERS = ''.,''NLS_ISO_CURRENCY = Japan') salary FROM employees;SELECT NLS_UPPER(last_name, 'NLS_SORT = Swiss') "Last Name" FROM employees;SELECT last_name FROM employeesORDER BY NLSSORT(last_name, 'NLS_SORT = German');Note: In some languages, some lowercase characters correspondto more than one uppercase character or vice versa. As a result, thelength of the output from the NLS_UPPER, NLS_LOWER, and NLS_INITCAP functions can differ from the length of the input.Working in a Global Environment 11-23

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

Saved successfully!

Ooh no, something went wrong!