Re: Mutating Error

From: Sybrand Bakker <gooiditweg_at_sybrandb.demon.nl>
Date: Fri, 22 Nov 2002 21:22:29 +0100
Message-ID: <sc4ttuc0kvfcgm9d1vqtiucn094j3gokb9_at_4ax.com>


On 22 Nov 2002 11:25:31 -0800, james.stewart2_at_ccra-adrc.gc.ca (JimS) wrote:

>Hi,
>
> I have a problem that I think someone can help me with. I create a
>BEFORE trigger on one of my tables. In the trigger I perform a SELECT
>to verify if a value exists before performing the update. It give me
>a "mutating error". Can I not code SELECT's in Triggers. It seems to
>simple. If so, why am I getting this error.
>
>Thanks in advance.
>
>Jim
>
>P.S. If you would like to email, send to
>james.stewart2_at_nospamccra-adrc.gc.ca
>
>Please omit nospam to email.

You are selecting from the table you are updating. That is forbidden. If you only want to check uniqueness, one might want to ask why you didn't implement a primary or unique key. They'll do *exactly* the check you're hardcoding now.

Hth

[Quoted] Sybrand Bakker, Senior Oracle DBA

To reply remove -verwijderdit from my e-mail address Received on Fri Nov 22 2002 - 21:22:29 CET

Original text of this message