Error while inserting date column [message #599946] |
Wed, 30 October 2013 06:34 |
|
stalin4d
Messages: 226 Registered: May 2010 Location: Chennai, Tamil Nadu, Indi...
|
Senior Member |
|
|
I am trying to insert some values into a table from a form i get the below error;
which says not a valid month;
FRM-40735 WHEN-BUTTON-PRESSED trigger raised unhandled exception ORA-01843
after i do google i added the below one to the insert statement and again i receive the error;
to_date(to_char(sysdate,'dd/mm/yyyy'),'dd/mm/yyyy')
My Insert Statement
insert into Invoice123
(Invoiceno, invdate, gross_tot, discount)
values
(nvl(INVOICEno(j),0),
to_date(to_char(invdate(j),'dd/mm/yyyy'),'dd/mm/yyyy'));
commit;
by which format we can achieve this!
|
|
|
Re: Error While Insert Date Column! [message #599947 is a reply to message #599946] |
Wed, 30 October 2013 06:39 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
This:to_date(to_char(sysdate,'dd/mm/yyyy'),'dd/mm/yyyy') doesn't make any sense. SYSDATE is a function that returns date; there's no point in converting it to character, and then back to date.
Error you got is caused by values stored in INVDATE(j). What is its datatype? If it is date, you don't need any conversion function. If it is character, then TO_DATE is all you need, with appropriate date format mask. It means that you have to know in which format you stored values in there. Here we come, again, to conclusion that storing date values into character datatype columns leads to problems.
|
|
|
|
|
|
|
|