Re: How to loop a query that is only able to handle 1 ROW at a time?

2012-08-19 Thread Rob Pollock
Hi Incarus, You don't need a loop just a correlated subquery on the update: UPDATE TB1 SET Ivet=PREG_REPLACE('/TeXT/', '', Ivet); Example: mysql> CREATE TABLE blah(value INTEGER, square INTEGER); Query OK, 0 rows affected (0.17 sec) mysql> INSERT INTO blah(value) VALUES (1),(2),(3),(4),(5); Q

How to loop a query that is only able to handle 1 ROW at a time?

2012-08-19 Thread Incarus Derp
I have a two line query that is only able to handle 1 row per execution. Could any of you give me some insight on how I could loop this per every single row in the table? The query in question is: SELECT PREG_REPLACE('/TeXT/', '' , Ivet) FROM `DB1`.`TB1` INTO @VAR12; UPDATE `TB1` SET Ivet = @VAR12