user1117434
user1117434

Reputation: 11

Default Date Format in CSV file

I'm creating a CSV file from my application, using oracle. When I open the csv file created, the columns which include dates are formatted in a special format such as dd-mmm-yy and not dd/mm/yyyy which is what I was expecting.

What can be the reason for that and what can I do to prevent it from happening?

Upvotes: 1

Views: 2078

Answers (2)

Rob van Laarhoven
Rob van Laarhoven

Reputation: 8905

The reason is the default date format in NLS_DATE_FORMAT. It can be set in a lot of places: sql session (in a logon trigger), os variable, registry, pfile. Or it can be derived from settings like NLS_TERRITORY wich can be explicitly set or derived from the locale setting on the client.

SQL>alter session set NLS_DATE_FORMAT='DD/MM/YYYY';
SQL>[select csv statements;]

Probably will do the trick

Upvotes: 1

baliman
baliman

Reputation: 620

use TO_CHAR(date, 'format') function on your column where the format is dd/mm/yyyyy

Upvotes: 0

Related Questions