Re: Trigger : table is mutating

From: PERRET <jperret_at_freesurf.fr>
Date: 25 Jan 2001 15:29:01 GMT
Message-ID: <Xns9034A789D4B07jperretfreesurffr_at_193.252.19.141>


Hi stan,

I think you find the best way to solve my problem.

Thanks

stan <stan_taylor_at_gmacm.com> wrote in <3a68f1e4.10157447_at_news>:

>Absolutely correct, which is why I recommended reviewing the
>documentation. There are many reasons not to use it, but it is there
>for those cases where its functionality fits the design intent.
>
>Which brings me to the next question. If what we are trying to do is
>identify which row in a table is the MAIN one, why don't we have a
>unique indicator which points to the correct value, rather than have
>to worry about setting more than one value correctly. For example,
>assume that we have a table 'indicator_table' which has two columns,
>'table_name' and 'table_row_identifier'. In this table would be a row
>with values '.ADRESSEFAC_CLIENT' and 'some identifier which indicates
>the row which is the main one'. Then the body of our trigger is
>something like
>
>BEGIN
> IF UPDATING AND :NEW.main=3D'Y' THEN
> update indicator_table
> set table_row_identifier = identifier for this row being
>updated
> where table_name = 'ADRESSEFAC_CLIENT';
> END IF;
>END;
>
>or something like this. No mutating table, better semantics including
>transactional consistency, and a repeatable pattern that can be used
>consistently for any similar situation.
>
>Better?
>
>
Received on Thu Jan 25 2001 - 16:29:01 CET

Original text of this message