Subject | AW: [firebird-support] Insert Trigger which makes an Update if pk allready there possible? |
---|---|
Author | Steffen Heil |
Post date | 2004-08-20T18:29:45Z |
Hi
Just a new idea:
What about deleting the old row, in a "BEFORE INSERT" trigger?
Insertion would stay insertion. This should work.
BUT remember: Foreign key should not be involved here!
(Because temporary deleting the original row to enable the insert would
cause ON DELETE actions.)
Regards,
Steffen
> Is it possible to write an Insert Trigger that test for the existence ofthe pk and then make an Update of the data if it allready exist?
Just a new idea:
What about deleting the old row, in a "BEFORE INSERT" trigger?
Insertion would stay insertion. This should work.
BUT remember: Foreign key should not be involved here!
(Because temporary deleting the original row to enable the insert would
cause ON DELETE actions.)
Regards,
Steffen