Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error on Insert sql statement (Date field)

Status
Not open for further replies.

wwworg

Programmer
Feb 10, 2006
35
0
0
CA
Hey guys

I am running jsp scripts using Tomcat 5.5 and Oracle8i.

I am getting an error while running an insert statement

error is "javax.servlet.ServletException: ORA-01843: not a valid month"

Now this is occuring on the date field. Please note that I am simply inserting hardcoded dates in the format of "01-JAN-2005". I believe this is the default format for oracle. Why isnt this working???

Here is the complete sql statement

String insertQuery = "INSERT INTO JOB_REQUISITION("
+ "JBR_DEPT_TBLGRPCD, "
+ "JBR_UNITNO, "
+ "JBR_SEQ_NBR, "
+ "JBR_REQUEST_ID, "
+ "JBR_REQUEST_DT, "
+ "JBR_STS_CD, "
+ "JBR_STS_DT, "
+ "JBR_JOB_ORG_ID, "
+ "JBR_JOB_TBLGRPCD, "
+ "JBR_JOB_CLASS, "
+ "JBR_LST_UPDT_IP_ADDR, "
+ "JBR_LST_UPDT_ID, "
+ "JBR_LST_UPDT_TS) VALUES('"
+ dptGrpCode + "', '"
+ department + "', "
+ nextJobReqNum + ", '"
+ ofcLogin.getEscUser() + "', '01-JAN-2005', 'OP', '01-JAN-2005', '"
+ organization + "', '"
+ jobGrpCode + "', '', '"
+ remoteIp + "', '"
+ ofcLogin.getEscUser() + "', '01-JAN-2005' )";

dbc.executeUIDQuery(insertQuery);

I would appreciate any help.
Thanks
 
Try wrapping each date in 'To_Date(''01-JAN-2005'',''DD-MON-YYYY'')'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top