Go Back   CodingForums.com > :: Server side development > MySQL > Other Databases

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-29-2013, 08:43 PM   PM User | #1
WolfShade
Regular Coder

 
Join Date: Apr 2012
Location: St. Louis, MO, USA
Posts: 950
Thanks: 7
Thanked 98 Times in 98 Posts
WolfShade is an unknown quantity at this point
Question Oracle 10g - delete record that doesn't exist

Hello, everyone.

In Oracle 10g, if an attempt is made to delete a record from the database that doesn't exist, will it throw an error?
__________________
^_^

If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
*
The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".
WolfShade is offline   Reply With Quote
Old 01-29-2013, 10:09 PM   PM User | #2
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,210
Thanks: 59
Thanked 3,996 Times in 3,965 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
If it throws an error, then it's not conformant with ANSI SQL, at all.

ANSI says a DELETE that affects zero records is never an error.

I would be truly surprised if Oracle went against ANSI on something this fundamental.

*********

If you are only looking to see how many records were deleted, most DB interfaces will give you that information.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote
Old 01-29-2013, 10:11 PM   PM User | #3
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,210
Thanks: 59
Thanked 3,996 Times in 3,965 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
Quote:
delete a record from the database that doesn't exist
Ummm...I'm assuming you meant that to read
Code:
delete a non-existent record from an existing database
If the database itself doesn't exist, yes, you will get an error.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote
Old 01-30-2013, 01:48 PM   PM User | #4
WolfShade
Regular Coder

 
Join Date: Apr 2012
Location: St. Louis, MO, USA
Posts: 950
Thanks: 7
Thanked 98 Times in 98 Posts
WolfShade is an unknown quantity at this point
Quote:
Originally Posted by Old Pedant View Post
If it throws an error, then it's not conformant with ANSI SQL, at all.

ANSI says a DELETE that affects zero records is never an error.

I would be truly surprised if Oracle went against ANSI on something this fundamental.

*********

If you are only looking to see how many records were deleted, most DB interfaces will give you that information.
Thanks, Pedant. I didn't think it would, but I've got a weird error when trying to delete a record. Trying to track down what is causing it, and thought that _maybe_ Oracle was erroring if the record did not exist.
__________________
^_^

If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
*
The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".
WolfShade is offline   Reply With Quote
Old 01-30-2013, 08:58 PM   PM User | #5
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,210
Thanks: 59
Thanked 3,996 Times in 3,965 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
Oracle does allow you to DELETE from views, but then it puts restrictions on that (which I think you'd need to be an Oracle guru to understand...some are really weird!).

Is it possible that is what is happening here? That you think you are deleting from a table but it's really from a VIEW of a table?
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote
Old 01-30-2013, 09:15 PM   PM User | #6
WolfShade
Regular Coder

 
Join Date: Apr 2012
Location: St. Louis, MO, USA
Posts: 950
Thanks: 7
Thanked 98 Times in 98 Posts
WolfShade is an unknown quantity at this point
I don't know about VIEW, but I do know that whenever there's that kind of an issue, it's usually with SYNONYMS, not VIEWS.
__________________
^_^

If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
*
The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".
WolfShade is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:16 PM.


Advertisement
Log in to turn off these ads.