Note
- For OceanBase Database V4.3.x, this variable was introduced in OceanBase Database V4.3.1.
- For OceanBase Database V4.2.x, this variable was introduced in OceanBase Database V4.2.2.
Description
lc_time_names specifies the language in which date and month names and their abbreviations are displayed.
Applicability
This variable is applicable to only OceanBase Database in MySQL mode.
Limitations
Query the variable
Global-level operation
In the
systenant or a user tenant, you can execute theSHOW VARIABLESstatement to query the variable at the global level or query theinformation_schema.GLOBAL_VARIABLESview (in MySQL mode) for the variable at the global level.Session-level operation
In the
systenant or a user tenant, you can execute theSHOW VARIABLESstatement to query the variable at the session level or query theinformation_schema.SESSION_VARIABLESview (in MySQL mode) for the variable at the session level.
Modify the variable
Global-level operation
In the
systenant, you can directly change the value of the variable at the global level.In a MySQL user tenant, you must have the
SUPERorALTER SYSTEMprivilege to change the value of the variable at the global level.
Session-level operation
In the
systenant or a user tenant, you can directly change the value of the variable at the session level for the current tenant.
Attributes
| Attribute | Description |
|---|---|
| Type | Varchar |
| Default value | en_US |
| Value range |
|
| Effective scope |
|
| Modifiable | Yes. You can use the SET statement to modify the variable. |
Considerations
This variable affects the output of the DATE_FORMAT(), DAYNAME() and MONTHNAME() functions, but does not affect the output of the STR_TO_DATE() or GET_FORMAT() function.
Examples
Take the output of a date function as an example:
Set the language in which the date and month names and their abbreviations are displayed to English.
Set the variable at the session level
obclient> SET lc_time_names='en_US';Set the variable at the global level
obclient> SET GLOBAL lc_time_names='en_US';
Query the current value of
lc_time_names.obclient> show variables like "lc_time_names";The return result is as follows:
+---------------+-------+ | Variable_name | Value | +---------------+-------+ | lc_time_names | en_US | +---------------+-------+ 1 row in set (0.015 sec)Use the
DAYNAME()function to query the day of the week of the input date.obclient> select DAYNAME('2023-01-06');The return result is as follows:
+-----------------------+ | DAYNAME('2023-01-06') | +-----------------------+ | Friday | +-----------------------+ 1 row in set (0.000 sec)