jsp and sql and dates!
843835Sep 11 2002 — edited Sep 11 2002Hi
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)");