Updating multiple rows in pl sql

Take your productivity to new heights with query tools, visual analytics, and ER diagramming for multiple platforms.

What I love about writing SQL Tuning articles is that I very rarely end up publishing the findings I set out to achieve. We have a table containing years worth of data, most of which is static; we are updating selected rows that were recently inserted and are still volatile. For the purposes of the test, we will assume that the target table of the update is arbitrarily large, and we want to avoid things like full-scans and index rebuilds.

Other sessions can only query the rows, but they cannot update, delete, or select with FOR UPDATE.

Oracle provides the FOR UPDATE clause in SQL syntax to allow the developer to lock a set of Oracle rows for the duration of a transaction.

The interesting thing about this method is that it performs a context-switch between PL/SQL and SQL for every FETCH; this is less efficient.

I include it here because it allows us to compare the cost of context-switches to the cost of updates.

We must declare the cursor with the FOR UPDATE clause to use this feature.

In this tutorial, we are going to learn how to use SQL in PL/SQL.

SQL is the actual component that takes care of fetching and updating of data in the database whereas PL/SQL is the component that processes these data.

The INSERT command can also take the values directly from another table using 'SELECT' statement rather than giving the values for each column.

Through 'SELECT' statement, we can insert as many rows as the base table contains.

Search for updating multiple rows in pl sql:

updating multiple rows in pl sql-78updating multiple rows in pl sql-58

I worry about how ETL tools apply updates (did you know Data Stage applys updates singly, but batches inserts in arrays? The two most common forms of Bulk Updates are: Case 1 is uninteresting.

Leave a Reply

Your email address will not be published. Required fields are marked *

One thought on “updating multiple rows in pl sql”