Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 12735 invoked from network); 27 Jun 2007 09:57:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 27 Jun 2007 09:57:06 -0000 Received: (qmail 54517 invoked by uid 500); 27 Jun 2007 09:57:07 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 54355 invoked by uid 500); 27 Jun 2007 09:57:06 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 54344 invoked by uid 99); 27 Jun 2007 09:57:06 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Jun 2007 02:57:06 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of pravinrane32@gmail.com designates 64.233.162.227 as permitted sender) Received: from [64.233.162.227] (HELO nz-out-0506.google.com) (64.233.162.227) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Jun 2007 02:57:02 -0700 Received: by nz-out-0506.google.com with SMTP id q3so109409nzb for ; Wed, 27 Jun 2007 02:56:41 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:from:to:references:subject:date:message-id:mime-version:content-type:content-transfer-encoding:x-mailer:thread-index:x-mimeole:in-reply-to; b=DF5Tsn64BamHWCU0y2zSnnqfQE65PrStf3vgJmwXw580FboVFaNomahKiZ59LKjKAiW1YLO3DdmltCGwu5VpkmAJvCo3p9ddOaQJ1o0YlgWXYRqaFKiHvFku4AJor6kPxrKvilbHh84sC9k/VMok0TPkZXvTzL//watEKv5Glw4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:from:to:references:subject:date:message-id:mime-version:content-type:content-transfer-encoding:x-mailer:thread-index:x-mimeole:in-reply-to; b=Td44QtUH/kX6ivr+myWHfa9yvUIAyXIG10+Pe8WHK22O4pC07i4Y5/5CbQkocxPhYsY6VBukj1H0q7JODj2g257TgnGwhZhh8EeMud+SwiMe0NNk4zmgQmS0hl8cd9jYAr6R2Yd2yodZyxvYLlErMyqlKWwWUNXjxIyyoUfRKtM= Received: by 10.114.133.1 with SMTP id g1mr327563wad.1182938199606; Wed, 27 Jun 2007 02:56:39 -0700 (PDT) Received: from ps2037 ( [59.163.69.2]) by mx.google.com with ESMTP id l23sm10156829waf.2007.06.27.02.56.37 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 27 Jun 2007 02:56:38 -0700 (PDT) From: "Pravin Rane" To: , References: <46822195.5030700@innovations.de> <95A15C4363D79944971A2D1CB36F5D49023128D2@APAXM2103.dir.svc.accenture.com> Subject: RE: How to use system date Date: Wed, 27 Jun 2007 15:27:09 +0530 Message-ID: <010001c7b8a1$89c4a5c0$182d4d0a@persistent.co.in> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 thread-index: Ace4lnwbfAy2FV4eRBCrSG3/u/gesQAAEJPAAAJy3sA= X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138 In-Reply-To: <95A15C4363D79944971A2D1CB36F5D49023128D2@APAXM2103.dir.svc.accenture.com> X-Virus-Checked: Checked by ClamAV on apache.org 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.