Thread: Re: [SQL] CREATE RULE ON UPDATE/DELETE

Re: [SQL] CREATE RULE ON UPDATE/DELETE

From
Stephan Szabo
Date:
> Don't think so.  I think the rule doesn't make any sense.
> NEW.id and OLD.id are probably dbl values, so saying OLD.id=id (where id
> is raw.id since that's the update table) isn't correct.  It probably
> should be OLD.id=id*2 (which seems to work for me, btw)  It's editing
> a different row than the one that's being selected.

I forgot to mention in this that I needed to made an additional change in
the rule to make the ids come out correct at the end :(.  The update set
id=NEW.id should be id=NEW.id/2 of course...  Otherwise the +10 becomes a
+20.