p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Oracle ASP (http://p2p.wrox.com/forumdisplay.php?f=106)
-   -   ORA-01843 not a valid month (http://p2p.wrox.com/showthread.php?t=86259)

adhe2chazper January 8th, 2012 06:42 AM

ORA-01843 not a valid month
 
I create a table member with 8 fields, with idMember as primaryKey. Two among these fields is the field's date_of_birth and date_back that have same type, date.
But when I insert data into it, appears an error like this -> ORA-01843 not a valid month.
Previously when I didn't include a date field again, successfully. However when I include it, writing error ORA-01843 not a valid month.

I give the insert command like this:
insert into member values ​​('M102019', 'Adhe Nurcahya',.., to_date ('28-May-1992 ',' DD-MON-YYYY'),..., .. , to_date ('12-dec-2011 ',' DD-MON-YYYY '));

Anyone know why is this possible?
I'm confused, is there because in a record to_date there should be no more than 1??
Thank's..

disel2010 January 10th, 2012 09:55 AM

Hi,

you should be able to insert two date fields in one insert statement.
Perhaps the order of your table fields is not matching up with the order you have in the insert statement?
Try specifying your columns to be sure. It should look like this then:
Code:


INSERT INTO member(column1, column2, column5, column8)
VALUES ('M102019', 'Adhe Nurcahya',to_date ('28-May-1992 ',' DD-MON-YYYY'),to_date ('12-dec-2011 ',' DD-MON-YYYY '));


adhe2chazper January 13th, 2012 01:03 PM

Quote:

Originally Posted by disel2010 (Post 280215)
Hi,

you should be able to insert two date fields in one insert statement.
Perhaps the order of your table fields is not matching up with the order you have in the insert statement?
Try specifying your columns to be sure. It should look like this then:
Code:


INSERT INTO member(column1, column2, column5, column8)
VALUES ('M102019', 'Adhe Nurcahya',to_date ('28-May-1992 ',' DD-MON-YYYY'),to_date ('12-dec-2011 ',' DD-MON-YYYY '));


thx disel.. I did get it yesterday.. [:D]
It don't work bcause I haven't turned the nls_format_date.. [:)]


All times are GMT -4. The time now is 09:52 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.