Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Date format columns
yavior_at_mercury.co.il (Yaron Avior) wrote in message news:<1b00d968.0111080152.5f0ca111_at_posting.google.com>...
> Hi,
> I want to use an american date format (mm/dd/yy) when inserting data
> into tables. i.e : INSERT INTO TABLE (X,Y,DATE)
> VALUES (9,'DDD','11/24/01').
> I receive the following error : "ORA-01843: not a valid month",
> although I have a trigger on my db : TRIGGER TR_LOGON
> AFTER LOGON ON DATABASE
> BEGIN
> EXECUTE IMMEDIATE('ALTER SESSION SET NLS_DATE_FORMAT=MM/DD/YY');
> END;
>
> what should I do to be able using queries as described ?
>
> thanks
If you execute your sql statement above in sqlplus it should error off as you are missing single quotes around the date format which must appear like 'mm/dd/yy' within the quoted string:
UT1> select sysdate from dual;
SYSDATE
UT1> @tdate UT1> set serveroutput on UT1> -- UT1> -- UT1> begin
PL/SQL procedure successfully completed.
UT1> select sysdate from dual
2 /
SYSDATE
![]() |
![]() |