Demonstrates the %ROWCOUNT cursor attribute by using a single-row implicit cursor based on the DUAL pseudotable : Cursor ROWCOUNT « Cursor « Oracle PL / SQL






Demonstrates the %ROWCOUNT cursor attribute by using a single-row implicit cursor based on the DUAL pseudotable

 
SQL>
SQL> DECLARE
  2    n NUMBER;
  3  BEGIN
  4    SELECT 1 INTO n FROM dual;
  5    dbms_output.put_line('Selected ['||SQL%ROWCOUNT||']');
  6  END;
  7  /
Selected [1]

PL/SQL procedure successfully completed.

   
  








Related examples in the same category

1.Cursor attributes: FOUND NOTFOUND, ROWCOUNT
2.modified the cursor FOR LOOP presented earlier to include %ROWCOUNT:
3.IF csr_org%ROWCOUNT = 1 THEN
4.Check SQL%ROWCOUNT after update statement
5.Implicit Cursor Attributes: If the previous UPDATE statement didn't match any rows, insert a new row into the place table
6.sql%rowcount macro