Subject | Re: [firebird-support] Insert Trigger which makes an Update if pk allready there possible? |
---|---|
Author | Helen Borrie |
Post date | 2004-08-20T12:59:01Z |
At 02:01 PM 20/08/2004 +0200, you wrote:
can't change the operation to be "insert" if it was "update" or to "update"
if it was "insert". All you could do here would be to have a routine to
create a different value for the PK and thus prevent the key
violation; but this isn't what you want here.
/heLen
>Is it possible to write an Insert Trigger that test for the existence ofNo, a trigger acts as part of a specific operation (I/U/D) so a trigger
>the pk and then make an Update of the data if it allready exist?
can't change the operation to be "insert" if it was "update" or to "update"
if it was "insert". All you could do here would be to have a routine to
create a different value for the PK and thus prevent the key
violation; but this isn't what you want here.
>Or must I use a Stored Procedure?Yes, you can achieve this very elegantly with a stored procedure
/heLen