Multiple choice technology databases

You are declaring a variable of data type NUMBER in a PL/SQL block. During the execution of the PL/SQL block, a query returns seven rows, and the next FETCH statement is issued. If the variable was assigned a value by using %ROWCOUNT attribute, which of the following values will be stored in it?

  1. 0

  2. 8

  3. 7

  4. NULL

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The %ROWCOUNT attribute returns the cumulative number of rows fetched from the cursor so far. Since a query returned seven rows and the last successful fetch retrieved the seventh row, %ROWCOUNT holds 7. Distractors like 8, 0, or NULL are incorrect because 7 rows have been successfully fetched.