Recently I encountered an issue when running SQL in SQL plus client: it cannot return results in SQL Plus while in SQL Developer it works fine using the same SQL statement.
After checking the Oracle’s National Language Support (NLS) in SQL Developer and SQL Plus, I found that they have different client session language.
To check the language:
|
In SQL Developer, we can also check the language by clicking Tools → Preference → Database → NLS → Language.
Below are the test results:
- In SQL developer:
- In SQL plus:
The inconsistency of the query results using the 2 tools is due to we have set the language as "AMERICAN" in SQL Developer but don't have that setup for SQL Plus via the registry and Oracle Home Client settings.
To change the client session language:
|
After the language is changed, it gives the same results in SQL Plus and SQL developer in our case.
Ref:
https://community.oracle.com/thread/2428916
https://cinhtau.net/2016/11/15/change-client-session-language-in-sqlplus/