Friday, 5 September 2008

Displaying dates and times with Oracle

I use SQLDeveloper when interacting with Oracle. When viewing tables with date columns it can be frustrating that the default display does not show time (just day, month and year).

To change this behaviour, you can set the date format for your current session:
alter session set NLS_DATE_FORMAT='DD-Mon-YYYY HH24:MI:SS'
Now, when you view tables or resultsets, you'll have a more precise view of the data:
04-Sep-2008 09:07:51

0 comments:

Post a Comment