Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

jsp and sql and dates!

843835Sep 11 2002 — edited Sep 11 2002
Hi

When I try to run this statement I get the following error:

ORA-01861: literal does not match format string

"insert into ps_cs_stock_grants_hist values('90980','2002-01-07 00:00:00.0','ONGO','2002-01-07 00:00:00.0','1250','0','USD','96','NQ','2002-01-07 00:00:00.0','N','N','N','622745', '2002-04-17 00:00:00.0','1250','5','BEL_5C_DX ',' ','0','C', '2002 Ongoing Stock PartI ', '2002-04-17 00:00:00.0')"

I know my problem is with dates as it works when I replace 2002-01-07 with 07-JUL-2002. Question is how? This is the code that creates the above:

int i = myStmt.executeUpdate("insert into ps_cs_stock_grants_hist values('" + vEmplid + "','" + vGrantdate + "','" + vOptionreason + "','" + vBoarddt + "','" + vOriginalopt + "','" + vOrigacqpc + "','" + vCurrencycd + "','" + vOptionplan + "','" + vOptiontype + "','" + vSpliteligdt + "','" + vRefusegrant + "','" + vStockoptplan + "','" + vCommitment + "','" + vGrantno + "', '" + vRegisterdate + "','" + vRegistershares + "','" + vStockvesting + "','" + vVestingtemplat + "','" + vVpemplid + "','" + vVestcredit + "','" + vGrantstatus + "', '" + vComments + "', sysdate)");
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 9 2002
Added on Sep 11 2002
3 comments
211 views