Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > Oracle ASP
| Search | Today's Posts | Mark Forums Read
Oracle ASP Using ASP with Oracle databases. For Oracle discussions not specific to ASP, please see the Oracle forum. For more ASP discussions, please see the ASP forum category.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Oracle ASP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old January 8th, 2012, 06:42 AM
Registered User
Points: 13, Level: 1
Points: 13, Level: 1 Points: 13, Level: 1 Points: 13, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2011
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Default 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..
  #2 (permalink)  
Old January 10th, 2012, 09:55 AM
Authorized User
Points: 448, Level: 7
Points: 448, Level: 7 Points: 448, Level: 7 Points: 448, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2011
Posts: 86
Thanks: 1
Thanked 12 Times in 12 Posts
Default

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 '));
The Following User Says Thank You to disel2010 For This Useful Post:
adhe2chazper (January 13th, 2012)
  #3 (permalink)  
Old January 13th, 2012, 01:03 PM
Registered User
Points: 13, Level: 1
Points: 13, Level: 1 Points: 13, Level: 1 Points: 13, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2011
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by disel2010 View Post
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..
It don't work bcause I haven't turned the nls_format_date..


Similar Threads
Thread Thread Starter Forum Replies Last Post
ORA-20505 sellyh19 Oracle 0 January 17th, 2011 06:35 AM
Converting month name to month number kalyanykk SQL Server 2005 7 August 19th, 2008 10:37 PM
ORA-0134 db009 Oracle 0 February 23rd, 2007 06:04 AM
[Oracle][ODBC][Ora][ORA-01013 Corey Access 1 December 15th, 2006 10:29 AM
query Current Month, Month+1, Month+2, Month+3 anterior Access 2 September 24th, 2006 08:25 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.