Home » SQL & PL/SQL » SQL & PL/SQL » Date format error
Date format error [message #329666] Thu, 26 June 2008 03:08 Go to next message
sdhanuka
Messages: 173
Registered: March 2008
Senior Member
hey i have included this in my query which creates an sql report

       TO_CHAR(SYSDATE,'DY MON DD HH24:MI:SS YYYY') 
       *

ERROR at line 10:
ORA-01401: inserted value too large for column 



it works fine from the sqlplus command prompt

SQL> select to_char(sysdate, 'DY MON DD HH24:MI:SS YYYY') from dual;

TO_CHAR(SYSDATE,'DYMONDD
------------------------
THU JUN 26 13:38:56 2008

Re: Date format error [message #329670 is a reply to message #329666] Thu, 26 June 2008 03:19 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
The column that you are trying to insert this value into is too small to hold the 24 chr string.

BUT

Don't do this. Don't store a date as a string in a varchar2 field.
Just change the column to be a DATE type and insert sysdate into it.
Re: Date format error [message #329671 is a reply to message #329666] Thu, 26 June 2008 03:19 Go to previous message
flyboy
Messages: 1832
Registered: November 2006
Senior Member
> ORA-01401: inserted value too large for column
sometimes I praise Oracle for having understandable error messages. this is one of these cases.

> hey i have included this in my query which creates an sql report
I am afraid that nobody except you has any idea, what the "sql report" is (maybe Forms?).
so, if you have any question, the answer is in the beginning of this post.
Previous Topic: ORA-06512
Next Topic: SQL request without PL/SQL
Goto Forum:
  


Current Time: Sat Dec 10 16:28:49 CST 2016

Total time taken to generate the page: 0.12198 seconds