Skip to content

Commit fe95151

Browse files
committed
Show SQL statements to find the DB and client character sets.
1 parent e3516f2 commit fe95151

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

doc/api.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8318,7 +8318,7 @@ Node-oracledb always uses Oracle's AL32UTF8 character set internally.
83188318
Data will be converted between AL32UTF8 and the
83198319
database character set when it is inserted into, or queried from, the
83208320
database. The environment variable `NLS_LANG` can be used to
8321-
configure the Oracle client language and territory only.
8321+
configure the Oracle 'client' (i.e. node-oracledb) language and territory only.
83228322
83238323
Oracle NLS environment variables, or statements like `ALTER SESSION`,
83248324
can be used to configure further aspects of node-oracledb data access
@@ -8327,6 +8327,24 @@ globalization. Examples are `NLS_NUMERIC_CHARACTERS` (discussed in
83278327
in [Fetching Numbers and Dates as String](#fetchasstringhandling)).
83288328
Refer to [NLS Documentation][69] for others.
83298329
8330+
To find the database character set, execute the query:
8331+
8332+
```sql
8333+
SELECT value AS db_charset
8334+
FROM nls_database_parameters
8335+
WHERE parameter = 'NLS_CHARACTERSET'
8336+
```
8337+
8338+
The general Oracle statement to find the 'client' character set is:
8339+
8340+
```sql
8341+
SELECT DISTINCT client_charset AS client_charset
8342+
FROM v$session_connect_info
8343+
WHERE sid = SYS_CONTEXT('USERENV', 'SID');
8344+
```
8345+
8346+
In node-oracledb this will always show AL32UTF8.
8347+
83308348
## <a name="endtoend"></a> 21. End-to-end Tracing, Mid-tier Authentication, and Auditing
83318349
83328350
The Connection properties [action](#propconnaction),

0 commit comments

Comments
 (0)