db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chong Yoke Ping <chon...@gmail.com>
Subject Re: Problem with doDelete
Date Mon, 06 Jun 2005 04:48:01 GMT
Hi,

    You are using the column (TIME.EDATE) twice in the criteria. Please 
take a look at this http://db.apache.org/torque/criteria-howto.html

Regards,
Yoke Ping

Kalyani Kale wrote:

>Hi,
>
>I have a problem with doDelete of torque. This is a sample piece of my
>code.
>
> 
>
>conn = Transaction.beginOptional( "db", true );
>
> 
>
>DateFormat df = new SimpleDateFormat("MM/dd/yyyy");
>
>Date d1 = df.parse("05/15/2005");
>
>Date d2 = df.parse("05/21/2005");
>
>                                    
>
>Criteria c = new Criteria();
>
>c.add(Time.LOGINID, getLoginID());                                 
>
>c.add(Time.EDATE, d1, Criteria.GREATER_EQUAL);
>
>c.add(Time.EDATE, d2, Criteria.LESS_EQUAL);
>
>                                    
>
>Time.doDelete(c, conn);
>
> 
>
>Transaction.commit( conn );
>
> 
>
>Now, ideally this should delete the records of Time table having EDate
>between 15th May 2005 and 22nd May 2005.
>
>But it does not consider date d2 at all and deletes all the records that
>are greater than d1.
>
> 
>
>What could be the problem?
>
> 
>
>Thanx,
>
>Kalyani
>
> 
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message