Re: after statement trigger, updating table

From: SANJAY PURI <skp_at_ix.netcom.com>
Date: 7 Oct 1994 21:00:36 GMT
Message-ID: <374ctk$dvh_at_ixnews1.ix.netcom.com>


In <36ua7p$45t_at_aragorn.unibe.ch> acherman_at_asterixiam.unibe.ch (Franz Achermann) writes:

>
>Hi,
>
>I have the following problem:
>
>I would like to make an 'UPDATE' on table A, with every 'INSERT' of
>a row into table A.
>I cannot use 'after row trigger' since table A is locked, when
>doing an insert of several rows. So I would like to use an after statement
>trigger, looping over all inserted rows, and doing the correct update.
>
>How can I select exactly these rows, which has been entered by the
>INSERT Statement causing the after statement trigger to fire ?
>
>I see one solution:
>
>using a row trigger, which stores each ROWID of table a when insered into
>an external table. The after statement trigger then reads this external table,
>is doing the update of Table A, and deleting the external table (or at least
>all rows in it).
>
>Big honor to the one, proposing a better solution.
>
>Franz Achermann (acherman_at_iwi.unibe.ch)
>
>

Hi Franz,

I think that you can use the BEFORE row trigger and take the new values of the fields by prefixing it with :new. This way, you will not have the locking problem.

Vijaya Kumar Nair Received on Fri Oct 07 1994 - 22:00:36 CET

Original text of this message