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 8500387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:55:53+00:00 2026-06-11T00:55:53+00:00

Disclaimer: I don’t have much SQL experience, and I don’t know what version of

  • 0

Disclaimer: I don’t have much SQL experience, and I don’t know what version of Oracle my company is using.

I have a product price table that needs to be updated tomorrow. There are several thousand records that will be getting updated, but still a thousand more that will go untouched.

Right now I have an update statement for every single record, and while I can run them all as a script I would like to get some sort of feedback as to how many records were updated, and if possible what statements failed.

If I run what I have as a script I’ll end up with some 5,000 “1 row updated” messages with no clue as to which one failed if I see a “0 rows updated”.

Is there some form of script I can use that will catch failures, or at the very least collect the number of rows updated into one total?

  • 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. Editorial Team
    Editorial Team
    2026-06-11T00:55:55+00:00Added an answer on June 11, 2026 at 12:55 am

    Does your product price table have some sort of modified date or last modified by fields? If so, make sure you’re updating these.

    Also, if using your script, you should set echo on and spool to a log file. Your script should look something like:

    -- updates.sql
    set serveroutput on
    set echo on
    WHENEVER SQLERROR EXIT SQL.SQLCODE
    spool on
    spool updates.log
    
    -- put updates here
    
    commit;
    spool off
    

    Log into sqlplus from the same directory as this file and run using: @updates.sql

    The updates.log file will have each statement that is run.

    If you wanted to get a total from a list of separate update statements, you’d need to inspect SQL%ROWCOUNT after each update. Something like (untested):

    declare 
      l_total pls_integer := 0;
    begin
      update product set x = 'foo' where y='bar';
      l_total := l_total + SQL%ROWCOUNT;
    
      update product set x = 'blah' where y='someval';
      l_total := l_total + SQL%ROWCOUNT;
    
      commit;
      dbms_output.put_line(l_total);
    end
    /
    

    This is a basic pl/sql anonymous block, and can be used with the spool strategy above.

    Finally, it is common to setup a basic log table, containing a message field, log datetime, some context fields (where the message is coming from, etc), type of msg (log, error), etc. Setup a procedure that handles inserting into the log table ( autonomous transaction), and then use the log procedure whenever you need to keep track of stats or whatever (dbms_output is very limited). Your environment might already have something like this, you just need to look for it (or ask a senior dev in your company).

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

Sidebar

Related Questions

Disclaimer: I don't really know what I'm doing, so I may have phrased things
Disclaimer: I don't have a whole ton of experience with Java Generics, but my
Disclaimer: I don't actually know anything about nether Oracle nor Java. The issue is
Disclaimer: I am using ExtJS 3, but I don't think it's very relevant to
Disclaimer: I am new to python and django but have Drupal programming experience. I'm
Disclaimer, I'm from a Java background. I don't do much C#. There's a great
Background Disclaimer: I have very little experience with Java. We previously used a wrapped
Disclaimer Yes, I know: don't use PASSWORD(password) to encrypt passwords . I don't want
(Disclaimer: I don't know what the C++ standard might say about this..I know, I'm
Disclaimer: I would love to be using dependency injection on this project and have

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.