it might be a silly question...but I am new in using mysql. I am trying to write a stored procedure, is there a command in mysql so that i can iterate all the records of a table and edit them? i need something like a for loop to iterate among the records of a table.
you may be looking for cursors (http://dev.mysql.com/doc/refman/5.1/en/cursors.html).
Be aware that many (though not all) tasks can be achieved with a single SQL statement and usually with better performance. If there is a way to do the updates by direct SQL queries it's almost always faster than by a cursor, so you should only use them if there is no other way to achieve what you want to do.
Users browsing this forum: Google [Bot] and 3 guests
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum