Updating multiple rows in oracle

MERGE is what is known as a deterministic statement.

That is, you can only update the same row of the target table once in the same MERGE statement.

Refer to "Database Object Naming Rules" for information on database object names.

The column aliases following the statement and in most types of subqueries.

updating multiple rows in oracle-75updating multiple rows in oracle-9updating multiple rows in oracle-83updating multiple rows in oracle-63
emp_last_name); END; / CREATE TABLE employees_temp AS SELECT first_name, last_name FROM employees; DECLARE x VARCHAR2(20) := 'my_first_name'; y VARCHAR2(25) := 'my_last_name'; BEGIN INSERT INTO employees_temp VALUES(x, y); UPDATE employees_temp SET last_name = x WHERE first_name = y; DELETE FROM employees_temp WHERE first_name = x; COMMIT; END; / statement that is explained in "Using the EXECUTE IMMEDIATE Statement in PL/SQL".

For information on the use of PL/SQL records with SQL to update and insert data, see "Inserting PL/SQL Records into the Database" and "Updating the Database with PL/SQL Record Values".


Leave a Reply