Change Output Result date/time format of Oracle Query with Visual Studio Code

Viewed 346

I am using Visual Studio Code ( Version 1.59.0 ) with Oracle Developer Tools for VS Code as Extension and i want to change the output results . Currently , with Oracle SQL Developer ( Version 20.4.1.407 ) I have the following results for dates :

Format 1

Format 2

Where, at my VS Code, the output for the same query return as :

Format 1

Format 2

My system format date does not equals to the output ( and that is ok, not a problem here , but also, not a solution ).

So, what i need to do or go to have an option to change the output result format for the date and time ? =)

Thank you all =)

1 Answers

Before you issue the query (in the same session) issue ALTER SESSION SET nls_date_format='your_date_format_here'

https://docs.oracle.com/en/database/oracle/oracle-database/19/refrn/NLS_DATE_FORMAT.html#GUID-FC23EEEE-AA9F-4B3C-8CBB-888C9C0CA27F

https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/Format-Models.html#GUID-EAB212CF-C525-4ED8-9D3F-C76D08EEBC7A

At some point we plan to add a feature to automatically execute commands like this with each session that is established (eg via a login.sql file or similar), but for now you will need to do it yourself or use a login trigger (if you are reading this post in the future, check for the login.sql feature first).

Related