Re: OT] how to update 2 values in each of 3000 records in MySQL

2011-05-18 Thread Pete
OK, sounds like you have to update each record individually based on a product code of some sort which I'd guess is probably the primary key. If that's the case, updating should be very fast. Don't know if updating 1 record at a time would be faster than batching the updates into 10/20/30 at a ti

Re: OT] how to update 2 values in each of 3000 records in MySQL

2011-05-18 Thread Matthias Rebbe
Hi, thanks so far to all for your suggestions. The database is from an online shop (xtCommerce) I have to update the products table which has no indexes: 1. setting a product active/inactive 2. setting the shipping time of a product (on stock, not on stock, ordered) 3. adjust the available quant

Re: OT] how to update 2 values in each of 3000 records in MySQL

2011-05-18 Thread Pete
You can update as many records as you want in one instruction as long as you can identify them in a WHERE statement: UPDATE tablea SET field1="newvalue" WHERE tablea.fielda="oldvalue" Pete Molly's Revenge On Wed, May 18, 2011 at 8:55 AM, Bob Sneidar wrote: > I

Re: OT] how to update 2 values in each of 3000 records in MySQL

2011-05-18 Thread Pete
There shouldn't be any problem accessing a mysql database over a network if the administrator has allowed you access to it. Hard to say whether that's "the right way". Updating values in 3000 records shouldn't be a very time consuming activity but as Terry said, it's hard to say without knowing a

Re: OT] how to update 2 values in each of 3000 records in MySQL

2011-05-18 Thread Bob Sneidar
I was under the impression you could only update one record at a time in SQL. Sure you can stack queries together and send them all at once (I guess that would be quicker). Is there a limit on the size of a SQL statement? Bob On May 17, 2011, at 11:56 PM, Terry Vogelaar wrote: > Whether you

Re: OT] how to update 2 values in each of 3000 records in MySQL

2011-05-17 Thread Terry Vogelaar
Hi Matthias, I don't think you should call this OT; sounds on topic to me. Of course it is hard to come up with a solution when we know so little about this particular database and the goal you try to accomplish with it. But you might reconsider the architecture of the database. If the 3000 re