It's perfectly possible to update multiple columns in the same statement, and in fact your code is doing it. So why does it seem that "INV_TOTAL is not updating, only the inv_discount"?

Because you're updating INV_TOTAL with INV_DISCOUNT, and the database is going to use the existing value of INV_DISCOUNT and not the one you change it to. So I'm afraid what you need to do is this:

UPDATE INVOICE
   SET INV_DISCOUNT = DISC3 * INV_SUBTOTAL
     , INV_TOTAL    = INV_SUBTOTAL - (DISC3 * INV_SUBTOTAL)     
WHERE INV_ID = I_INV_ID;

Perhaps that seems a bit clunky to you. It is, but the problem lies in your data model. Storing derivable values in the table, rather than deriving when needed, rarely leads to elegant SQL.

Answer from APC on Stack Overflow
🌐
TechOnTheNet
techonthenet.com › oracle › update.php
Oracle / PLSQL: UPDATE Statement
The syntax for the UPDATE statement when updating one table in Oracle/PLSQL is: UPDATE table SET column1 = expression1, column2 = expression2, ... column_n = expression_n [WHERE conditions]; ... The columns that you wish to update. ... The new values to assign to the column1, column2, ...
Discussions

sql - how to update multiple rows in oracle - Stack Overflow
I would like to update multiple rows with different values for all different records, but don't have any idea how to do that, i am using below sql to update for single record but i have 200 plus re... More on stackoverflow.com
🌐 stackoverflow.com
oracle - Updating Multiple Rows with Data from Column A into Column B? - Database Administrators Stack Exchange
I understand that I can do this ... statement. When trying to update multiple rows though I believe I'm getting stuck on having to have 60,000 unique key identifiers. This was what I used to update 1 of the records, I'm using Oracle SQL:... More on dba.stackexchange.com
🌐 dba.stackexchange.com
August 23, 2012
How To update multiple rows at the same time in SQL
Probably not the best idea unless they are both going up by the same amount or the same percentage. There has to be something in common. More on reddit.com
🌐 r/SQL
22
7
June 13, 2021
How to update multiple columns in the same table with the same sub-query in Oracle SQL - Stack Overflow
I see other SQL dialects have UPDATE ... SET ... FROM, but this does not seem to be in Oracle. ... drop table t1; drop table t2; create table t1 (col1 number, col2 number, col3 number); create table t2 (col1 number, col2 number, col3 number); insert into t1 values (1, 10, 100); insert into ... More on stackoverflow.com
🌐 stackoverflow.com
🌐
W3Schools
w3schools.com › sql › sql_update.asp
SQL UPDATE Statement
The following SQL updates the record with CustomerID = 1, with a new contact person AND a new city. UPDATE Customers SET ContactName = 'Alfred Schmidt', City= 'Frankfurt' WHERE CustomerID = 1; The selection from the "Customers" table will now look like this: The WHERE clause determines which records that will be updated.
🌐
TechOnTheNet
techonthenet.com › sql › update.php
SQL: UPDATE Statement
The syntax for the SQL UPDATE statement when updating multiple tables (not permitted in Oracle) is: UPDATE table1, table2, ... SET column1 = expression1, column2 = expression2, ... WHERE table1.column = table2.column [AND conditions]; column1, column2 · The columns that you wish to update. ...
🌐
Oracle Tutorial
oracletutorial.com › home › oracle basics › oracle update
Oracle UPDATE Statement
May 11, 2025 - To changes existing values in a table, you use the following Oracle UPDATE statement: UPDATE table_name SET column1 = value1, column2 = value2, column3 = value3, ... WHERE condition; Code language: SQL (Structured Query Language) (sql)
🌐
Quora
quora.com › How-do-I-update-multiple-rows-in-Oracle-SQL-with-different-values
How to update multiple rows in Oracle SQL with different values - Quora
Answer (1 of 3): a2a: You can do a case statement in SQL. update test set text = case when (flag='Y') then ('its now yes') when (flag='N') then ('its no now') else ('unknown') end; So you’d hard code the values in the where clauses and this lets you update multiple rows with different values...
🌐
Oracle
docs.oracle.com › javadb › 10.8.3.0 › ref › rrefsqlj26498.html
UPDATE statement
-- Indicate this by changing their job (JOB) to NULL and their pay -- (SALARY, BONUS, COMM) values to zero in the EMPLOYEE table. UPDATE EMPLOYEE SET JOB=NULL, SALARY=0, BONUS=0, COMM=0 WHERE WORKDEPT = 'E21' AND JOB <> 'MANAGER' -- PROMOTE the job (JOB) of employees without a specific job title to MANAGER UPDATE EMPLOYEE SET JOB = 'MANAGER' WHERE JOB IS NULL; // Increase the project staffing (PRSTAFF) by 1.5 for all projects stmt.executeUpdate("UPDATE PROJECT SET PRSTAFF = " "PRSTAFF + 1.5" + "WHERE CURRENT OF" + ResultSet.getCursorName()); -- Change the job (JOB) of employee number (EMPNO) '000290' in the EMPLOYEE table -- to its DEFAULT value which is NULL UPDATE EMPLOYEE SET JOB = DEFAULT WHERE EMPNO = '000290'
Find elsewhere
🌐
GeeksforGeeks
geeksforgeeks.org › pl/sql › how-to-update-multiple-rows-at-once-using-plsql
How to Update Multiple Rows at Once Using PL/SQL? - GeeksforGeeks
July 23, 2025 - CREATE TABLE Students ( Student ... 'Science', 75), ('Jane', 'English', 90); The UPDATE statement in Oracle PL/SQL enables the modification of multiple rows in a single operation....
🌐
Oracle
docs.oracle.com › cd › B19306_01 › server.102 › b14200 › statements_10007.htm
UPDATE
You cannot retrieve LONG types with this clause. You cannot specify this clause for a view on which an INSTEAD OF trigger has been defined. See Also: PL/SQL User's Guide and Reference for information on using the BULK COLLECT clause to return multiple values to collection variables
🌐
DataCamp
datacamp.com › tutorial › update-multiple-columns-sql
How to Update Multiple Columns in SQL | DataCamp
November 8, 2024 - My writing bridges technical depth ... and accuracy. Yes, you can update multiple rows with different values by using conditions in the WHERE clause or applying logic within the CASE statement....
Top answer
1 of 2
8

If you just want the discharge_dt to be overwritten with the admit_dt from the same row, it sounds like you just need

UPDATE patient
   SET discharge_dt = admit_dt
 WHERE facility_id = 'X'
   AND pat_seq IN (<<query that returns the 60,000 keys>>)
2 of 2
4

Cloyd, the description is indeed confusing.

I'll state some assumptions and work on them. Please, shall you consider this worth, comment out and I'll keep editing the answer until we get 'there'. Deal?

Let's go:

  • the update statement has as condition facility_id='X'

  • the sub-query at the assignment has no condition at all (except pat_seq)

  • therefore, I'm assuming and 'forecasting' that:

    • pat_seq is key for identification of a patient

    • both admit_dt and discharge_dt are of type date/time, not just date

    • the facility_id column at patient table keeps track of the several facilities within which the patient has been sent during it's (sad?) stay

    • for any patient, for each facility where it's been sent to, there has to be a row keeping track of date/time of admission and discharging, like:

      • pat_seq: 0015, facility_id: AABB, admit_dt: 15:35, discharge_dt:16:45
      • pat_seq: 0015, facility_id: CCA1, admit_dt:16:45, discharge_dt:17:10
      • pat_seq: 0015, facility_id: AAHD, admit_dt:17:10, discharge_dt: NULL
    • just the admitances are registered, hence for any new admitance registered there has to be an update action upon the imediate previous entry for which the discharge time will be assumed as the admitance time within the next facility

    • bullseye?

Well, for this scenario, you shall do, assuming a batch, scheduled task:

UPDATE patient 
SET discharge_dt = (
            /*
                For every entry past this, retrieve the least admit_dt, which shall identify the moment the pat_seq moved into the next facility
            */
            SELECT MIN(admit_dt)
            FROM patient pat_next_admit
            WHERE pat_next_admit.pat_seq  = patient.pat_seq
              AND pat_next_admit.admit_dt > patient.admit_dt
        ) 
WHERE discharge_dt IS NULL /* No need to process rows already processed! */
🌐
Database Star
databasestar.com › sql-update
SQL UPDATE Statement: A Complete Guide | Database Star: Home
January 2, 2020 - Another way of updating only the values you want is by using an inline view. Instead of specifying just the table, you can use a subquery, which is an inline view. This is also called an "update select". ... 1UPDATE ( 2 SELECT student_id, 3 first_name, 4 last_name, 5 fees_paid, 6 fees_required 7 FROM student 8 WHERE student_id = 2) std 9SET std.fees_paid = 450; This is another way of updating a single record using the Oracle SQL Update command.
🌐
Oracle
docs.oracle.com › en › database › oracle › oracle-database › 26 › sqlrf › UPDATE.html
SQL Language Reference
February 24, 2026 - If the expr list contains a primary ... a BEFORE UPDATE trigger defined on it. You cannot specify the returning_clause for a multitable insert. You cannot use this clause with parallel DML or with remote objects. You cannot retrieve LONG types with this clause. You cannot specify this clause for a view on which an INSTEAD OF trigger has been defined. ... Oracle AI Database PL/SQL Language Reference for information on using the BULK COLLECT clause to return multiple values to collection ...
🌐
Oracle
forums.oracle.com › ords › apexds › post › sql-command-for-update-of-multiple-rows-5350
SQL command for UPDATE of multiple rows - Oracle Forums
December 21, 2009 - Hi, how to write SQL command to updating multiple rows in one statement? I tried as follows from TOAD which worked: UPDATE TableA SET a = 'x' WHERE b = 'a'; UPDATE TableA SET a = 'x' WHERE b = 'b; UP...
🌐
Oracle
blogs.oracle.com › sql › how-to-update-columns-in-one-table-with-data-from-another-using-oracle-sql
How to update columns in one table with data from another using Oracle SQL | sql
September 11, 2025 - Direct join syntax is a simple way to change one table’s columns using values from another table. Added in Oracle AI Database 26ai. In earlier releases, an update-only merge is an effective alternative. If you need to update the join columns, use an update on a subquery. If all else fails, you can use a correlated subquery update. In all cases, an update can only change each row once. ... Chris Saxon is an Oracle Developer Advocate for SQL.
🌐
Quora
quora.com › Can-we-update-multiple-rows-at-once-using-PL-SQL
Can we update multiple rows at once using PL/SQL? - Quora
Next, assign a new value for the column that you want to update. In case you want to update data in multiple columns, each (column = value) pair is separated by a comma (,). Then, specify whic...