On Sun, 19 Sep 2004, Alex wrote: >Hi, > >The point is that if the OR REPLACE clause is specified, INSERT may >overwrite an existing row instead of inserting a new one. In this case the >appropriate record in the secondary db must be deleted. However, I cannot do >it because OLD is not available inside the INSERT trigger regardless of the >operation actually performed.
If there is an "OR REPLACE" clause on your primary key, then you know exactly which row to delete from the secondary db. It will be the one with the same primary key as the new row. So, for each insert, just delete the row from the secondary db with the same key. If it doesn't exist, you'll have lost nothing (a bit of time, perhaps, as you'll have to do a negative index scan.) Then just insert the data as you would normally do. > >Thanks, >Alex > Christian -- /"\ \ / ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL X - AGAINST MS ATTACHMENTS / \