Note
This variable is available starting with V2.2.30.
Description
nls_date_format specifies the format for converting a date type to a string and for implicitly converting a string to a date.
Applicability
This variable is applicable only to OceanBase Database in Oracle mode.
Privilege requirements
Query variables
Global level
The
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
The
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
The
systenant can directly modify the value of a global system variable.An Oracle user tenant must have the
ALTER SYSTEMprivilege to modify the value of a global system variable.
Session level
The
systenant and all user tenants can directly modify the value of a session system variable.
Attributes
| Attribute | Description |
|---|---|
| Parameter type | Varchar |
| Default value | DD-MON-RR |
| Scope |
|
| Modifiable | Yes. You can execute the SET statement to modify the value. |
Usage
The start_date parameter is of the DATE type. The value of start_date is converted to text in the format specified by the NLS_DATE_FORMAT system variable and then passed to the SQL text. The date and time format model can be simply a text string enclosed in double quotation marks.
Examples
Set the format for converting a date type 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';
