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.

Locale-Dependent <strong>SQL</strong> Functions with Optional NLS ParametersSuch a query can be made independent of the current date language by using astatement similar to the following:SELECT last_name FROM employeesWHERE hire_date > TO_DATE('01-JAN-1999','DD-MON-YYYY','NLS_DATE_LANGUAGE = AMERICAN');In this way, <strong>SQL</strong> statements that are independent of the session language can bedefined where necessary. Such statements are necessary when string literals appear in<strong>SQL</strong> statements in views, CHECK constraints, or triggers.Note: Only <strong>SQL</strong> statements that must be independent of thesession NLS parameter values should explicitly specify optionalNLS parameters in locale-dependent <strong>SQL</strong> functions. Using sessiondefault values for NLS parameters in <strong>SQL</strong> functions usually resultsin better performance.All character functions support both single-byte and multibyte characters. Exceptwhere explicitly stated, character functions operate character by character, rather thanbyte by byte.The rest of this topic includes the following topics:■ Default Values for NLS Parameters in <strong>SQL</strong> Functions■ Specifying NLS Parameters in <strong>SQL</strong> Functions■ Unacceptable NLS Parameters in <strong>SQL</strong> Functions11.4.1 Default Values for NLS Parameters in <strong>SQL</strong> FunctionsWhen <strong>SQL</strong> functions evaluate views and triggers, default values from the currentsession are used for the NLS function parameters. When <strong>SQL</strong> functions evaluateCHECK constraints, they use the default values that were specified for the NLSparameters when the database was created.11.4.2 Specifying NLS Parameters in <strong>SQL</strong> FunctionsNLS parameters are specified in <strong>SQL</strong> functions as 'parameter = value'. For example:'NLS_DATE_LANGUAGE = AMERICAN'The following NLS parameters can be specified in <strong>SQL</strong> functions:NLS_DATE_LANGUAGENLS_NUMERIC_CHARACTERSNLS_CURRENCYNLS_ISO_CURRENCYNLS_DUAL_CURRENCYNLS_CALENDARNLS_SORTTable 11–5 shows which NLS parameters are valid for specific <strong>SQL</strong> functions.Table 11–5<strong>SQL</strong> FunctionTO_DATE<strong>SQL</strong> Functions and Their Valid NLS ParametersValid NLS ParametersNLS_DATE_LANGUAGE,NLS_CALENDAR11-22 <strong>SQL</strong> <strong>Developer</strong> Online Help

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

Saved successfully!

Ooh no, something went wrong!