Dale Johnson wrote: > "Jan Wieck" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED]... > > mlw wrote: > > > [...] > > > REPLACE into table set xx=yy, ww = zz where ID = fubar; > > > > > > A MUCH better solution! > > > > Please solve the trigger problem at least theoretical before > > claiming that mySQL is that MUCH better. And please don't > > solve it by ripping out trigger support :-) > > > for INSERT OR REPLACE into table ... > if the record was not there, fire the insert trigger > else > delete the row (fire delete trigger) > insert the new row (fire the insert trigger) > fi > > semantically no other way, I think I'm not sure I agree. There are explicit triggers for update, insert, and delete, therefor why not also have a trigger for replace? It is one more case. Rather than try to figure out how to map replace into two distinct behaviors of insert or update based on some conditional logic, why not just have a replace trigger? ---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
