oceanbase / obclient

A MariaDB-based command line tool to connect to OceanBase Database.
https://open.oceanbase.com
GNU General Public License v2.0
82 stars 43 forks source link

[Feature]: Permanently change the NLS_DATE_FORMAT setting #28

Open jiugem opened 6 months ago

jiugem commented 6 months ago

Describe your use case

It is recommended that obclient first try to read OB related settings from the operating system environment variable NLS_DATE_FORMAT. See Oracle sqlplus behavior.

When the operating system does not set the time display format, select sysdate from dual; output: 11-March-24

After operating system configuration variables export NLS_DATE_FORMAT="yyyy-mm-dd hh24:mi:ss" export NLS_TIMESTAMP_FORMAT="yyyy-mm-dd hh24:mi:ss"

select sysdate from dual; PLSQL, sqlplus output SYSDATE: 2024-03-11 13:05:31

Avoid script execution after obclient login database connection: ALTER SESSION SET NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'; ALTER SESSION SET NLS_TIMESTAMP_FORMAT='YYYY-MM-DD HH24:MI:SS.FF6';

Describe the solution you'd like

I'm not sure how PLSQL DEVELOPER and SQLplus read related variables when obclient starts.

Describe alternatives you've considered

No response

Additional context

No response