Hello !
I want to create a stored procedure in mysql 5.0 to update one field, with 2 input parameters, old value and new, but in the new one I want to put more then 1 value,
In fact I want to duplicate a row many times and to update a field in each new row with a different value. Something like this:
Update tableX set columnX = 'B' where columnX = 'A'
Update tableX set columnX = 'C' where columnX = 'A'
Update tableX set columnX = 'D' where columnX = 'A'
but after first update there is no 'A'.
I want to keep inalterate others values from row of A
the procedure I think do something
procedX(A,B)
procedX(A,C)
procedX(A,D)
I must to mention that I haven't values B, C, D in the same time, they are read sequential from an other file.
Is there a sql method to do this ?
Now I read (in
VB.NET) a datatable (charged with multiple rows ) and then I replace A from each row from datatable with B, C, D, then I save those new rows, and then remove row with A - but this code is very slowly for a table with 5000 pairs like (A,B) from I read.
Thank you !