To be pedantic, Oracle doesn't care what the date format
is, it will always sort properly on dates regardless of format.

Sorting within perl is another matter: put the year first.

Jared

On Sunday 26 January 2003 23:46, Michael A Chase wrote:
> On Mon, 27 Jan 2003 00:24:58 -0700 (MST) Doug Hughes <[EMAIL PROTECTED]> wrote:
> > I've got some fields in an oracle table where the internal format
> > is date. I'm currently using a select * type query to return
> > all the colums of the table (36), and the date fields come back
> > as 'MM/DD/YYYY'.
> > I could enumerate every column and for each data field do
> > a select to_char(field,'MM/DD/YYYY HH24:MI:SS'), but that
> > seems rather tedious and I was thinking there must be a better
> > way. Is there some way to do the equivalent of an alter system
> > to set the NLS_DATE_FORMAT for retrieving date fields?
>
> You'll need to check the fine Oracle SQL manual to be sure, but I
> think "ALTER SESSION SET NLS DATE FORMAT TO 'YYYY/MM/DD HH24:MI:SS'"
> or something similar would do what you want.  I recommend putting the
> year first since that makes sorting and parsing easier.

Reply via email to