Responses inline... On Tue, Sep 30, 2008 at 9:21 AM, Weston, Craig (OFT) <[EMAIL PROTECTED]> wrote: > > Rob, > I tried this on the small test data, a larger data set and it appears to > make my day. I sincerely appreciate your willingness to help me out. > > I do have some questions, mostly so I can understand how this works > better: > > I was wondering what the lines: > > set odone = done; > set done = odone; Note the line: DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1; which is used to figure out when the cursor runs out data. However it can also get thrown by the SELECT. I'm sure there is a cleaner way to deal with this, I just don't know it, and have not take the time to look much for an alternative
> > do? I mean, in context, I understand they make variables do their thing, > but I wasn't sure why they were needed. > > Also > The statement > > set s_groupid =null; > > is very understandible, I just wondered why it was needed, or conversely > why the other variables were not set null at the end? > > Thank you. If "SELECT groupid INTO s_groupid FROM TEMP WHERE value IN(f1,f2) limit 1;" does not have any results then the s_groupid is not set, and continues to hold it's hold it's old value. As I am testing against that value, I need it to be reset. In retrospect it would be cleaner to do at the top of loop. For the record performance on large datasets using cursors sucks. Using something like the login above with with a looping updates would work much faster.... -- Rob Wultsch [EMAIL PROTECTED] wultsch (aim) -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]