Skip to Main Content

Oracle Developer Tools for VS Code

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

NLS_TIMESTAMP_TZ_FORMAT quoted text can mangle data in grid

User_OHXALSep 14 2022

Given Oracle Developer Tools for VS Code 21.5.0 and the following SQL:

ALTER SESSION SET nls_timestamp_tz_format = 'yyyy-mm-dd"T"hh24:mi:ss.ff3TZH:TZM';
SELECT current_timestamp FROM dual;

If I execute these with ⌃E, the data grid shows a mangled result:
image.pngNote a pair of double quotes where the letter T should be:
Punctuation and quoted text is reproduced in the result.
Datetime Format Models
If I Save as… JSON the result is also mangled:

[
  {
    "CURRENT_TIMESTAMP": "2022-09-14\"\"10:48:22.776+10:00"
  }
]

sqlplus instead shows the value I expect:

SQL> ALTER SESSION SET nls_timestamp_tz_format = 'yyyy-mm-dd"T"hh24:mi:ss.ff3TZH:TZM';

Session altered.

SQL> SELECT current_timestamp FROM dual;

CURRENT_TIMESTAMP
----------------------------------------
2022-09-14T10:50:11.643+10:00

The mangling seems specific to data transferred as a TIMESTAMP WITH TIME ZONE. I get the correct result executing this SQL to convert it to a VARCHAR2, for example:

SELECT to_char (current_timestamp, 'yyyy-mm-dd"T"hh24:mi:ss.ff3TZH:TZM') FROM dual;
Comments
Post Details
Added on Sep 14 2022
0 comments
70 views