Subject | Re: [firebird-support] Insert Trigger which makes an Update if pk allready there possible? |
---|---|
Author | Nando Dessena |
Post date | 2004-08-26T07:13:06Z |
Andreas,
A> Is it possible to write an Insert Trigger that test for the existence of
A> the pk and then make an Update of the data if it allready exist?
yes; you can create a view on the table and define your before insert
trigger on the view.
As others have mentioned, you can do the same in a slightly simpler
but less transparent way by means of a stored procedure.
Ciao
--
Nando Dessena
mailto:nandod@...
======================================================
I support Firebird, I am a Firebird Foundation member!
Join today at http://www.firebirdsql.org/ff/foundation
======================================================
A> Is it possible to write an Insert Trigger that test for the existence of
A> the pk and then make an Update of the data if it allready exist?
yes; you can create a view on the table and define your before insert
trigger on the view.
As others have mentioned, you can do the same in a slightly simpler
but less transparent way by means of a stored procedure.
Ciao
--
Nando Dessena
mailto:nandod@...
======================================================
I support Firebird, I am a Firebird Foundation member!
Join today at http://www.firebirdsql.org/ff/foundation
======================================================