List:General Discussion« Previous MessageNext Message »
From:Rob Wultsch Date:September 30 2008 4:35pm
Subject:Re: Many to many to too many relation.
View as plain text  
Responses inline...

On Tue, Sep 30, 2008 at 9:21 AM, Weston, Craig (OFT)
<Craig.Weston@stripped> 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
wultsch@stripped
wultsch (aim)
Thread
Many to many to too many relation.OFT)29 Sep
  • Re: Many to many to too many relation.Rob Wultsch30 Sep
    • RE: Many to many to too many relation.OFT)30 Sep
      • Re: Many to many to too many relation.Peter Brawley30 Sep
        • Re: Many to many to too many relation.Rob Wultsch30 Sep
      • Re: Many to many to too many relation.Rob Wultsch30 Sep
        • RE: Many to many to too many relation.OFT)30 Sep
        • RE: Many to many to too many relation.OFT)30 Sep
          • Re: Many to many to too many relation.Rob Wultsch30 Sep