db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fumi <fmhk1...@ybb.ne.jp>
Subject Re: AW: Why SQL statement is not terminated correctly?
Date Sat, 04 Oct 2003 04:34:24 GMT
Hi Vitali,

Thanx(Arigatou) for your reply.
Sorry for my slow reply & my poor english.

"Usselmann, Vitali" <Usselmann@elkware.com> wrote:
> I can not tell you the difference between your code fragments.
> I solved my problems with Criteria.or() by using the Criterion
> object instead of Criteria.or() as shown at the bottom of:
> http://db.apache.org/torque/peers-howto.html

I tried to solve this problem using Criterion as you mentioned.
But i couldn't...
-----------------------------------------
Criteria crit = new Criteria();
Criteria.Criterion cond1 = 
  crit.getNewCriterion(EmpPeer.JOB,
                        (Object)"Engineer",
                        Criteria.EQUAL);
Criteria.Criterion cond2 =
  crit.getNewCriterion(EmpPeer.HIREDATE,
                        Calendar.getInstance().getTime(),
                        Criteria.LESS_THAN);
crit.add(cond1.or(cond2));
EmpPeer.doDelete(crit);    (*1)
EmpPeer.doSelect(crit); (*2)
------------------------------------------

whereClause for (*1) was JOB='Engineer', 
and for (*2) was 
(EMP.JOB='Engineer' OR 
EMP.HIREDATE<TO_DATE('04-10-2003 13:23:17', 'DD-MM-YYYY HH24:MI:SS')).

Why whereClause was different between Select and Delete(Update)?

Thanx in advance.




---------------------------------------------------------------------
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