ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pravin Rane" <pravinran...@gmail.com>
Subject RE: How to use system date
Date Wed, 27 Jun 2007 09:57:09 GMT
Hi Bharathi,

I am not sure how good this solution is but you can convert date to
'dd-mm-yyyy' character representation and then compare it with query
parameter. This will return the desired result set.

Regards
~Pravin

-----Original Message-----
From: bharathi.mani@accenture.com [mailto:bharathi.mani@accenture.com] 
Sent: Wednesday, June 27, 2007 2:13 PM
To: ralf.assmann@innovations.de; user-java@ibatis.apache.org
Subject: RE: How to use system date

Can I use to_date(sysdate, 'dd-mm-yyyy') to remove the precision for
time of the day? Cos I have a value in db "27-JUN-2007'. But when I pass
to_date(sysdate, 'dd-mm-yyyy') to my select query in iBatis, it does not
return any value.
Any help in this will be great.
Thanks

-----Original Message-----
From: Ralf Assmann [mailto:ralf.assmann@innovations.de] 
Sent: Wednesday, June 27, 2007 2:07 PM
To: Mani, Bharathi
Subject: Re: How to use system date


Depending on your database, you can use the database' date, e.g. for a
db2:

"select * from test where date = current date"

The should be similar functions for other databases. Alternatively, make

a java.sql.Date using System.currentTimeMillis() and pass this
attribute.


Ralf Assmann

-------------------------------------------------------------------
Ralf Assmann, Dipl.-Ing. (FH)
Innovations Softwaretechnologie GmbH
Ziegelei 7, 88090 Immenstaad, Germany
Tel.: +49 7545 202-324
Tel.: +49 7545 202-300 (Zentrale)
Fax.: +49 7545 202-301
Email: ralf.assmann@innovations.de
Web: http://www.innovations.de
-------------------------------------------------------------------
Geschaeftsfuehrung: 
Achim Berger, Thomas Cotic, Walter Pitz
Reg.-Gericht Ulm HRB 631622
-------------------------------------------------------------------




bharathi.mani@accenture.com schrieb:
>
> Hi,
>
> How can I pass current system date to a select query in iBatis?
>
> 'Select * from test where data = sysdate'. Will this work?
>
> Thanks,
>
> Bharathi
>
> This message is for the designated recipient only and may contain 
> privileged, proprietary, or otherwise private information. If you have

> received it in error, please notify the sender immediately and delete 
> the original. Any other use of the email by you is prohibited.
>


This message is for the designated recipient only and may contain
privileged, proprietary, or otherwise private information.  If you have
received it in error, please notify the sender immediately and delete the
original.  Any other use of the email by you is prohibited.


Mime
View raw message