you should to use something like:
fecha_inicial = "16-May-2001 101010"

and then (when you try to insert):
to_date(:fecha_inicial,'dd-mon-yyyy hh24miss')

----- Original Message -----
From: "Nevarez, Benjamin" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 24, 2001 11:05 AM
Subject: Re: Prepared Statement and date


> I believe this is a database specific question
>
> Go to your Oracle SQL*Plus on do some tests like
>
> SQL> insert into emp (empno, hiredate) values (666, '01-Jan-2001');
>
> 1 row created.
>
> Try to use the SQL standard so your program can work on several databases.
> Well, forget my last sentence, if you already are using Oracle you won't
> need any other database never.
>
> Benjamin
>
>
> -----Original Message-----
> From: Albert Yip [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 16, 2001 7:42 AM
> To: [EMAIL PROTECTED]
> Subject: Prepared Statement and date
>
>
> Hi all,
>
> Just wondering about how should I deal with dates when trying to insert
data
> into db with prepared statements. I tried to use strings like "2001-05-16
> 10:10:10" but it keeps giving me error:
>
> java.sql.SQLException: ORA-01861: literal does not match format string
>
> any ideas? I would really appreciate it if someone can give a hand.
>
> Thanks,
> Albert
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to