head pic db4free graphic Menu pic db4free
 
















It is currently Tue 21 May, 2013 19:54

All times are UTC + 1 hour




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Mon 01 Jun, 2009 12:10 
Offline

Joined: Mon 01 Jun, 2009 11:55
Posts: 1
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.

thanks in advance!!!


Top
 Profile  
 
PostPosted: Wed 03 Jun, 2009 16:29 
Offline
Administrator
User avatar

Joined: Tue 07 Jun, 2005 17:34
Posts: 522
Location: Heidenreichstein, Austria
Hi,

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.

Cheers,
Markus

_________________
--- mpopp.net --- http://www.mpopp.net ---


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 0 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

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group