Note
This variable is available starting with V2.2.30.
Description
nls_date_format specifies the format for converting a date value to a string and for implicitly converting a string to a date value.
Applicability
This variable is available only in Oracle mode.
Privilege requirements
Query variables
Global level
systenant and all user tenants can execute theSHOW VARIABLESstatement or query theSYS.TENANT_VIRTUAL_GLOBAL_VARIABLEview (Oracle mode) to view the value of a global system variable.Session level
systenant and all user tenants can execute theSHOW VARIABLESstatement or query theSYS.TENANT_VIRTUAL_SESSION_VARIABLEview (Oracle mode) to view the value of a session system variable.
Modify variables
Global level
systenant can modify the value of a global system variable.Oracle user tenants must have the
ALTER SYSTEMprivilege to modify the value of a global system variable.
Session level
systenant and all user tenants can modify the value of a session system variable.
Attributes
| Attribute | Description |
|---|---|
| Type | Varchar |
| Default value | DD-MON-RR |
| Scope |
|
| Modifiable | Yes. You can execute the SET statement to modify the value. |
Usage
The data type of start_date is DATE. The value of start_date is converted to text in the format specified by the system variable NLS_DATE_FORMAT, and the result is passed to the SQL text. A date-time format model can be a simple text string enclosed in double quotation marks.
Examples
Set the format for converting a date value to a string to DD-MON-RR.
Session level
obclient> SET nls_date_format='DD-MON-RR';Global level
obclient> SET GLOBAL nls_date_format='DD-MON-RR';