Re: how to make a delete statement fail

  • From: Jack van Zanen <jack@xxxxxxxxxxxx>
  • To: oracle-l@xxxxxxxxxxxxx
  • Date: Thu, 27 Aug 2009 14:01:42 +1000

try deleting a parent key that has child keys still somewhere in a PK/FK
relationship

Jack

2009/8/27 Larry G. Elkins <elkinsl@xxxxxxxxx>

>  Delete trigger that raises error
>
>
>
> If execution plan uses index for criteria do an alter index xyz unusable,
> assuming skip_unusable_indexes is false (don’t do this if this is a
> multi-billion row table ;-))
>
>
>
>
>
> Larry G. Elkins
>
>
>
>
> Joe Smith wrote:
>
> How do I make a correct DELETE statement fail?  I have a developer that
> wants to test a code branch and he needs a delete statement to fail.
>
>
>
> It can’t be locked ( shared or exclusive ) from a separate session or be an
> incorrect statement or return “0 rows deleted.”
>
>
>
> It has to be “delete from table where col = value”.  How can I force that
> to fail?
>
>
>
>
>
>  thanks.
>
>
>
>
>
>
>  ------------------------------
>
> Windows Live: Keep your friends up to date with what you do online. Find
> out 
> more.<http://windowslive.com/Campaign/SocialNetworking?ocid=PID23285::T:WLMTAGL:ON:WL:en-US:SI_SB_online:082009>
>



-- 
Jack van Zanen

-------------------------
This e-mail and any attachments may contain confidential material for the
sole use of the intended recipient. If you are not the intended recipient,
please be aware that any disclosure, copying, distribution or use of this
e-mail or any attachment is prohibited. If you have received this e-mail in
error, please contact the sender and delete all copies.
Thank you for your cooperation

Other related posts: