Re: inserting date into oracle!!!

From: Date: Thu, 21 Feb 2002 14:32:11 +0000
Subject: Re: inserting date into oracle!!!
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-12188@lists.php.net to get a copy of this message
OK, it has been a long while since I've used Oracle, but from what I remember, the format of the date is *not* the one you are using. I believe it should look like this: yyyy-mm-dd or mm-dd-yyyy I may be wrong about the format, but I remember originally having trouble with the dates when I used oracle for the first time. Anyone have more insight? -Nicole www.aeontrek.com "Sandeep Murphy" <Sandeep.Murphy@oni.pt> wrote in message news:69E9C8885D77554CAF2A7C5C690F43595B629E@arexcprd01.e3g.pt... > 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

« previous php.windows (#12188) next »