Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: HELP! Default date format in SQL*Plus isn't dd-mon-yy!
"Andrew Allen" <andrew.allen_at_handleman.com> wrote in message
news:3E5CD9A8.1030004_at_handleman.com...
> R wrote:
> > Hi!
> >
> > I'm in a bind here. Doing some schoolwork and for some reason the
default
> > date format produced by SQL*Plus is not the expected dd-mon-year, but
> > YY-MM-DD. I've tried altering the settings in my Date/Time control panel
> > with no success.
<snip>
> OK, since you admit you are a student I will point you in the proper
> direction and leave it up to you to find the correct solution(s).
> 1. Oracle stores dates in an internal seven byte date format.
> 2. Oracle displays dates in a default format, as you listed (yy-mm-rr).
> 3. You can change the default display format, as well as comma/point for
> numbers using NLS settings -- I will leave it up to you to find what
> these are and how to set them system wide and at the session level.
> 4. NEVER - NEVER - NEVER ( I cannot say it enough ) NEVER rely on
> default date masks (format). ALWAYS use an explicit TO_DATE() or
> TO_CHAR() function to store or display dates. This way you never have
> to worry about the default date display format.
> It is probably good that you have been bitten by this bit of ( reliance
> on defalt ) foolihsness while still learning -- perhaps it will help
> lead you into good programming habits.
It's not ME! It's the script that was supplied to the students to create the default tables for us to work with!
> BTW, the date/time settings on your PeeCee have NOTHING to do with
> SQL*Plus and oracle display defaults.
I still don't understand why the default decimal character would be a comma.
What my problem (now resolved) was that I was not entering the ALTER SESSION statement correctly to set the NLS parameters. I was trying:
SET NLS_variable = whatever
and
ALTER SESSION NLS_variable = whaterver
but it's actually
ALTER SESSION SET NLS_variable = whatever
I'm finding Oracle to have the most inconsistent command structure that I've ever seen! Received on Thu Feb 27 2003 - 03:30:10 CST
![]() |
![]() |