that example assumes BOOK_ID is the primary key.

Ramesh Sabeti wrote:

I meant in the example provided by Bill.  If you set the criteria as
suggested, Torque would use it in the WHERE clause and not in the SET
clause, right?



-----Original Message-----
From: Tulsi Das [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 11, 2003 12:45 PM
To: Apache Torque Users List
Subject: RE: How to update multiple rows

It doesn´t know untill you call

doSelect()
or
doUpdate()
or even
doDelete() methods

that´s why it´s only called "Criteria"

regards

Tulsi

--- Ramesh Sabeti <[EMAIL PROTECTED]> escribió:


How does torque know that c.add(BookPeer.BOOK_PRICE, 0) is to SET a
value and not for comparison purposes?



-----Original Message-----
From: Bill Leng [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 11, 2003 6:18 AM
To: Apache Torque Users List
Subject: Re: How to update multiple rows

You can do something like this
Criteria c = new Criteria();
c.add(BookPeer.BOOK_PRICE, 0);
c.add(BookPeer.BOOK_ID, 100, Criteria.LESS_THAN);
BasePeer.doUpdate(c);

Ramesh Sabeti wrote:



I have a very simple question: How do you do something like this


with


Torque?

Update book set book_price = 0 where book_id < 100

Wish there were more online resources.

Thanks,

Ramesh.





---------------------------------------------------------------------


To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Bill Leng
Sr. Software Engineer
Metatomix, Inc.
Tel: (901)261-8911
Fax: (901)261-8901






---------------------------------------------------------------------


To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






---------------------------------------------------------------------


To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



------------
¡Ayudá a los chicos navegando!
En noviembre, Yahoo! dona un plato de comida por cada nuevo usuario


que


nevegue gratis con Yahoo! Conexión.
Conectate ya en http://conexion.yahoo.com.ar

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]




-- Bill Leng Sr. Software Engineer Metatomix, Inc. Tel: (901)261-8911 Fax: (901)261-8901



Reply via email to