oceanbase / oceanbase/obclient
[Feature]: Permanently change the NLS_DATE_FORMAT setting
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 94
- Forks
- 42
- PR merge metrics
- No merged PRs in 30d
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing obclient startup and session initialization to see how operating-system environment variables and session settings are currently handled. Compare the desired behavior with Oracle sqlplus, then verify that NLS_DATE_FORMAT and NLS_TIMESTAMP_FORMAT are applied automatically and produce the requested date and timestamp output without manual ALTER SESSION commands.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, shell, sql
- Domain
- cli, database
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100