Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 78511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T20:59:56+00:00 2026-05-10T20:59:56+00:00

I have a question regarding an update function I created… CREATE OR REPLACE FUNCTION

  • 0

I have a question regarding an update function I created…

CREATE OR REPLACE FUNCTION rm_category_update(icompany bpchar, iraw_mat_cat_code bpchar, iraw_mat_cat_desc bpchar)  RETURNS character AS  $BODY$  DECLARE    loc_result    CHAR(50);   BEGIN  UPDATE rm_category   SET     raw_mat_cat_code    = iraw_mat_cat_code,     raw_mat_cat_desc    = iraw_mat_cat_desc  WHERE company = icompany;  loc_result = 'success';  RETURN loc_result ;  END;  $BODY$  LANGUAGE 'plpgsql' VOLATILE;  ALTER FUNCTION rm_category_update(icompany bpchar, iraw_mat_cat_code bpchar, iraw_mat_cat_desc bpchar) OWNER TO postgres; 

Okay, so if I input a record that doesn’t exist, for example 9, it returns success even though I know it has updated nothing!

Does SQL not throw errors if it is updating a non-existent row??

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T20:59:56+00:00Added an answer on May 10, 2026 at 8:59 pm

    It depends on the DBMS – but no, it should not throw an error. According to the SQL standard (ISO/IEC 9075:2008 these days), it should set the SQLNOTFOUND condition (+100), which is separate from any error condition. (With Informix, if you use a MODE ANSI database, you get SQLNOTFOUND; if you use a non-ANSI database, you get 0 (no error) as the condition. The reasons for that pre-date the original SQL-86 standard.)

    Note that SQL is a set-based language. What you requested was that the statement update a set of (matching) rows — and it is perfectly valid to update a set containing zero (matching) rows.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 75k
  • Answers 75k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer I think what you are looking for is the swfbridge… May 11, 2026 at 2:48 pm
  • added an answer Figured it out the following line was being logged x30… May 11, 2026 at 2:48 pm
  • added an answer Yes. It does. Right click on the TFS project and… May 11, 2026 at 2:48 pm

Related Questions

I have a question regarding an update function I created... CREATE OR REPLACE FUNCTION
I need to make an application in .NET CF with different/single forms with a
I have a database table with a large number of rows and one numeric
Thanks for reading this. I am dynamically generating some data which includes a select
Background I'm writing an asynchronous comment system for my website, after reading plenty of

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.