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 applies only to OceanBase Database in Oracle-compatible mode.
Privilege requirements
Query variables
Global level
systenants and all user tenants can execute theSHOW VARIABLESstatement or query theSYS.TENANT_VIRTUAL_GLOBAL_VARIABLEview (Oracle-compatible mode) to obtain the value of a global system variable.Session level
systenants and all user tenants can execute theSHOW VARIABLESstatement or query theSYS.TENANT_VIRTUAL_SESSION_VARIABLEview (Oracle-compatible mode) to obtain the value of a session system variable.
Modify variables
Global level
systenants 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
systenants 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 start_date column has the DATE data type. The system variable NLS_DATE_FORMAT specifies the format model for converting the start_date value to a string. The converted string is then passed to the SQL text. The date and time format model can be a simple 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';