« Ridiculous Collection Agency ActivityVMWare ESX 3 - No Root ssh remote access by Default »

Oracle NLS_DATE_FORMAT

10/09/07

Permalink 09:37:46 pm by guy, Categories: Software Development, Oracle, Random Stuff

Oracle date formats are another annoying aspect of Oracle.

Why is it that in SQL Server I can format my dates almost any way I want and it will figure things out itself, but in Oracle I have to explicitly format my dates?

Here is an example of the query that I need to run before working with date fields in Oracle. If I don’t run this first then most of my applications misbehave. I also run this statement before most of my sessions in SQL Plus or SQL+ Worksheet:

ALTER SESSION SET NLS_DATE_FORMAT='DD-MON-YYYY HH24:MI:SS';

Without this statement query output with dates will only display the date portion of the date/time.

This is probably another example of the Oracle “with great power comes great responsibility” line of thinking.

October 2017
Sun Mon Tue Wed Thu Fri Sat
 << <   > >>
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        
I'm a generalist, at least if I'm honest. In my job I am primarily a developer, but also a sysadmin, and (as little as possible) technical support. I know a little about a lot of things, a lot about some things, and everything about nothing. Here I will post random learnings...

Search

XML Feeds

User tools

powered by b2evolution