Oracle Date Problem
|
Posted: 12/17/2004, 1:15 PM |
|
I have an update form which includes an Oracle date field. Whenever I try to submit an update to a record, it throws the following error:
java.sql.SQLException: ORA-01861: literal does not match format string
I am assuming I need to use the Oracle TO_DATE function to format this string into date format as part of the update process. I believe I need to make this change in this section of my jsp code:
sSQL = "update WQ_WORK_QUEUE set " +
"WQID=" + toSQL(fldWQID, Number_TYPE) +
",FOLLOWUP=" + toSQL(fldfollowup, Date_TYPE) +
",STATUSID=" + toSQL(fldSTATUSID, Number_TYPE) +
",NOTES=" + toSQL(fldnotes, Memo_TYPE);
sSQL = sSQL + " where " + sWhere;
break;
Can someone assist me with the proper syntax to update the FOLLOWUP field with TO_DATE. Any other suggestions are also appreciated.
Using CC 2.07 - JSP
|
|
|
Jon
|
Posted: 12/20/2004, 12:06 PM |
|
Try this...
",FOLLOWUP=to_date(" + toSQL(fldfollowup, Date_TYPE) + ",'yyyy-mm-dd HH24:MI:SS')"
caveat: I'm neither a Java nor an Oracle specialist, but this is essentially what I use to insert records into our Oracle DB via PHP.
|
|
|
Brian Hoogeveen
|
Posted: 01/03/2005, 1:38 PM |
|
Thanks, this formatted worked for me. Appreciate the help
|
|
|
|