Re: Update col to Y set all other to N in trigger.

From: Dominic Brooks <dombrooks_at_hotmail.com>
Date: Fri, 31 Jan 2020 07:21:58 +0000
Message-ID: <DB7PR04MB4443F09E39837000237DA032A1070_at_DB7PR04MB4443.eurprd04.prod.outlook.com>



Definitely not an autonomous transaction! Use a compound trigger, store the relevant information in a collection for each row, at the end of the statement sort out the non default rows.

http://stevenfeuersteinonplsql.blogspot.com/2016/12/get-rid-of-mutating-table-trigger.html?m=1

Sent from my iPhone

On 30 Jan 2020, at 23:53, Ethan Post <post.ethan_at_gmail.com> wrote:


I should recall how to do this but been a while.

I need the best way to

update foo set col='Y' where pk=1;

And have a trigger automatically...

update foo set col='N' where pk !=1;

While avoid mutating table error.

This one seems hard to google the answer to.

Thanks,
Ethan
e-t-h-a-n.com<http://e-t-h-a-n.com>
_at_poststop

--
http://www.freelists.org/webpage/oracle-l
Received on Fri Jan 31 2020 - 08:21:58 CET

Original text of this message