Over 10 Million Study Resources Now at Your Fingertips


Download as :
Rating : ⭐⭐⭐⭐⭐
Price : $10.99
Language:EN
Pages: 2

The collection passed forall has data rows through

FORALL indx IN INDICES OF l_top_employees
EXECUTE IMMEDIATE
'INSERT INTO ' || l_table || ' VALUES (:emp_pky, :new_salary)' USING l_new_salaries(indx).employee_id,
l_new_salaries(indx).salary;

Cursor attributes for FORALL

Description

SQL%FOUND
SQL%NOTFOUND SQL%ROWCOUNT

SQL%ISOPEN Always returns FALSE and should not be used.

SQL%BULK_ROWCOUNT Returns a pseudocollection that tells you the number of rows processed by each corresponding SQL statement executed via FORALL. Note that when %BULK_ROWCOUNT(i) is zero, %FOUND and %NOTFOUND are FALSE and TRUE, respectively.

my_books isbn_list
:= isbn_list (
'1-56592-375-8', '0-596-00121-5', '1-56592-849-0', '1-56592-335-9', '1-56592-674-9', '1-56592-675-7', '0-596-00180-0', '1-56592-457-6'

Bulk Processing for Repeated SQL Statement Execution | 881

);
BEGIN
FORALL book_index IN
my_books.FIRST..my_books.LAST
UPDATE books
SET page_count = page_count / 2
WHERE isbn = my_books (book_index);

Here are some tips on how this attribute works:

• The FORALL statement and %BULK_ROWCOUNT use the same subscripts or row numbers in the collections. For example, if the collection passed to FORALL has data in rows 10 through 200, then the %BULK_ROWCOUNT pseudocollection will also have rows 10 through 200 defined and populated. Any other rows will be undefined.

What happens when one of those DML statements fails?

882 |

Chapter 21: Optimizing PL/SQL Performance

How It Works
Login account
Login Your Account
Add to cart
Add to Cart
Payment
Make payment
Document download
Download File
PageId: ELIB08145E
img
Uploaded by :
8Ko6opOG
Page 1 Preview
the collection passed forall has data rows through
Sell Your Old Documents & Earn Wallet Balance