Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Regular Coder
    Join Date
    Apr 2012
    Location
    St. Louis, MO
    Posts
    985
    Thanks
    7
    Thanked 101 Times in 101 Posts

    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".

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,441
    Thanks
    76
    Thanked 4,372 Times in 4,337 Posts
    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.

  • #3
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,441
    Thanks
    76
    Thanked 4,372 Times in 4,337 Posts
    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.

  • #4
    Regular Coder
    Join Date
    Apr 2012
    Location
    St. Louis, MO
    Posts
    985
    Thanks
    7
    Thanked 101 Times in 101 Posts
    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".

  • #5
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,441
    Thanks
    76
    Thanked 4,372 Times in 4,337 Posts
    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.

  • #6
    Regular Coder
    Join Date
    Apr 2012
    Location
    St. Louis, MO
    Posts
    985
    Thanks
    7
    Thanked 101 Times in 101 Posts
    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".


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •