Re: Development question - Trigger to disallow UPDATE without WHERE clause?
- From: Phil Jones <phil@xxxxxxxxxx>
- To: "ChrisDavid.Taylor@xxxxxxxxxxxxxxx" <ChrisDavid.Taylor@xxxxxxxxxxxxxxx>
- Date: Fri, 27 Jan 2012 20:28:32 +0000
If v$sql gets populated before any records are actually processed (I imagine it
is, but a quick test will verify) & the sql_id in v$session also gets populated
after the query has been parsed but before any rows are processed you might be
able to do it in a before update trigger that throws an exception. You'll need
sys_context('USERENV','SID') to join with the v$ tables.
To be honest, you'd be better off using a cluebat on the devs :)
Phil
On 27 Jan 2012, at 20:13, "Taylor, Chris David"
<ChrisDavid.Taylor@xxxxxxxxxxxxxxx> wrote:
> Our developers are working on a large project that is going to require a lot
> of scripts to convert data and due to an error in one of the scripts one of
> our tables was fubar.
> So the question came up - is there a way in a trigger or other method to trap
> UPDATE statements that do not have a WHERE clause?
>
> I'm searching for this now but wanted to poll the list at the same time. Off
> the top of my head I couldn't come up with anything.
>
> Thanks!
>
> Chris
>
>
> --
> http://www.freelists.org/webpage/oracle-l
>
>
--
http://www.freelists.org/webpage/oracle-l
Other related posts: