inserting date into oracle!!!
| From: | Sandeep Murphy | Date: | Thu, 21 Feb 2002 09:56:38 +0000 |
| Subject: | inserting date into oracle!!! | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-12175@lists.php.net to get a copy of this message | ||
Hi,
I have been trying to insert the current date into ORACLE in vain...
my query reads like this..
java.text.SimpleDateFormat formatter = new
java.text.SimpleDateFormat("dd/MM/yyyy");
java.util.Date currentTime_1 = new java.util.Date();
String dateString = formatter.format(currentTime_1);
// Have to use Java.util.date....
out.println( "<br>" );
out.println( dateString ); // shows current date Fine..
sql = "INSERT into
RESERV_DOC_UPD(CODE,DOC_COD,COLAB_COD,RESERVED,DATE_RESERV)";
sql +=
"VALUES("+temp+","+code+","+COLAB_COD+","+RESERVED+","+(to_date(dateString,
dd/mm/yyyy))+")";
Can anyone Please tell me whats wrong with this query and the remedy for
it!!???
Thnx a lot in adv,
gaucho