Which NLS parameter can be used to change the default O…

Which NLS parameter can be used to change the default Oracle sort method from binary to linguistic for the
SQL SELECT statement?

Which NLS parameter can be used to change the default Oracle sort method from binary to linguistic for the
SQL SELECT statement?

A.
NLS_LANG

B.
NLS_COMP

C.
NLS_SORT

D.
None of the above

Explanation:
Neither NLS_SORT nor NLS_COMP cannot change sorting from BINARY to LINGUISTIC. Because the
NLS_SORT depends on NLS_COMP, if they are different, the sorting method will always be BINARY.
(Refer to NLS_SORT) The exact operators and query clauses that obey the NLS_SORT parameter depend on
the value of the NLS_COMP parameter. If an operator or clause does not obey the NLS_SORT value, as
determined by NLS_COMP, the collation used is BINARY.
The BINARY comparison is faster and uses less resources than any linguistic comparison but for text in a
natural language, it does not provide ordering expected by users.
The value of NLS_SORT affects execution plans of queries. Because a standard index cannot be used as a
source of values sorted in a linguistic order, an explicit sort operation must usually be performed instead of an
index range scan. A functional index on the NLSSORT function may be defined to provide values sorted in a
linguistic order and reintroduce the index range scan to the execution plan.
NLS_COMP specifies the collation behavior of the database session.



Leave a Reply 0

Your email address will not be published. Required fields are marked *