Re: how to make a delete statement fail

From: Robert Freeman <robertgfreeman_at_yahoo.com>
Date: Thu, 27 Aug 2009 05:53:47 -0700 (PDT)
Message-ID: <772362.3482.qm_at_web38908.mail.mud.yahoo.com>



Correct, it won't raise an error.... I responded to quickly, should have read the question closer!! :-)

RF

 Robert G. Freeman
Oracle ACE
Author:
Oracle Database 11g RMAN Backup and Recovery (Oracle Press) - ON IT'S WAY SOON! OCP: Oracle Database 11g Administrator Certified Professional Study Guide (Sybex) Oracle Database 11g New Features (Oracle Press) Portable DBA: Oracle (Oracle Press)
Oracle Database 10g New Features (Oracle Press) Oracle9i RMAN Backup and Recovery (Oracle Press) Oracle9i New Features (Oracle Press)
Other various titles out of print now... Blog: http://robertgfreeman.blogspot.com The LDS Church is looking for DBA's. You do have to be a Church member in good standing. A lot of kind people write me, concerned I may be breaking the law by saying you have to be a Church member. It's legal I promise! :-) http://pages.sssnet.com/messndal/church/parachurch.pdf

  • Original Message ---- From: "Bobak, Mark" <Mark.Bobak_at_proquest.com> To: "robertgfreeman_at_yahoo.com" <robertgfreeman_at_yahoo.com>; "joe_dba_at_hotmail.com" <joe_dba_at_hotmail.com>; "oracle-l_at_freelists.org" <oracle-l_at_freelists.org> Sent: Wednesday, August 26, 2009 9:14:59 PM Subject: RE: how to make a delete statement fail

But that won't actually raise an error, will it? Just cause 0 rows to be deleted.

-Mark



From: oracle-l-bounce_at_freelists.org [oracle-l-bounce_at_freelists.org] On Behalf Of Robert Freeman [robertgfreeman_at_yahoo.com] Sent: Wednesday, August 26, 2009 22:03
To: joe_dba_at_hotmail.com; oracle-l_at_freelists.org Subject: Re: how to make a delete statement fail

How about using the where clause:

delete from duplicate where duplicate_id=1 and 0=1;

So the statement is fundamentally correct except for the last predicate.

Robert G. Freeman
Oracle ACE
Author:
Oracle Database 11g RMAN Backup and Recovery (Oracle Press) - ON IT'S WAY SOON! OCP: Oracle Database 11g Administrator Certified Professional Study Guide (Sybex) Oracle Database 11g New Features (Oracle Press) Portable DBA: Oracle (Oracle Press)
Oracle Database 10g New Features (Oracle Press) Oracle9i RMAN Backup and Recovery (Oracle Press) Oracle9i New Features (Oracle Press)
Other various titles out of print now... Blog: http://robertgfreeman.blogspot.com The LDS Church is looking for DBA's. You do have to be a Church member in good standing. A lot of kind people write me, concerned I may be breaking the law by saying you have to be a Church member. It's legal I promise! :-) http://pages.sssnet.com/messndal/church/parachurch.pdf



From: Joe Smith <joe_dba_at_hotmail.com> To: oracle-l_at_freelists.org
Sent: Wednesday, August 26, 2009 7:20:41 PM Subject: how to make a delete statement fail

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>

--

http://www.freelists.org/webpage/oracle-l
--

http://www.freelists.org/webpage/oracle-l Received on Thu Aug 27 2009 - 07:53:47 CDT

Original text of this message