%rowcount - implicit cursor attributes, PL-SQL Programming

%ROWCOUNT

The %ROWCOUNT yields the number of rows affected by the INSERT, UPDATE, or DELETE statement, or returned by a SELECT INTO statement. The %ROWCOUNT yields zero when an

INSERT, UPDATE, or DELETE statement affected no rows, or the SELECT INTO statement return no rows. In the illustration below, you use the %ROWCOUNT to take the action if more than ten rows have been deleted:

DELETE FROM emp WHERE ...

IF SQL%ROWCOUNT > 10 THEN -- more than 10 rows were deleted

...

END IF;

If the SELECT INTO statement precedes more than one row, the PL/SQL raises the predefined exception TOO_MANY_ROWS and the %ROWCOUNT yields 1, not the actual number of rows that assure the query.

Posted Date: 10/4/2012 4:48:38 AM | Location : United States







Related Discussions:- %rowcount - implicit cursor attributes, Assignment Help, Ask Question on %rowcount - implicit cursor attributes, Get Answer, Expert's Help, %rowcount - implicit cursor attributes Discussions

Write discussion on %rowcount - implicit cursor attributes
Your posts are moderated
Related Questions
BETWEEN Operator The operator BETWEEN, tests whether the value lies in a specified series. That means "greater than or equivalent to low value and less than or equivalent to hig

Effects of NULL Operator As a general rule-but not a universal one-if NULL is an argument to an invocation of a system-defined read-only operator, then NULL is the result of t

1. a. Write a trigger that fires when a part's price is updated. The trigger will write a record into a table called PriceUpdates. The record should contain the information of

Using Pragma RESTRICT_REFERENCES: The function called from the SQL statements should obey certain rules meant to control the side effects. To check for violation of the rules,

Loop Labels Like the PL/SQL blocks, loops can also be labeled. The label, an undeclared identifier enclosed by double angle brackets, should appear at the beginning of the LOOP

CLOSE Statement The CLOSE statement allows the resources held by a cursor variable or open cursor to be reused. No more rows can be fetched from the cursor variable or closed

Referencing Records Unlike the elements in a collection, that are accessed using subscripts, the fields in a record are accessed by name. To reference an individual field, you

Seeking a programmer to design a legal document with pre-existing fields that could allow the auto-population of client(s) information (i.e. Name, Account Number, Address etc.) int

What Are Cursor Variables  ? The Cursor variables are like C or Pascal pointers that hold the memory location (address) of some item rather of the item itself. Therefore, decl

%NOTFOUND The %NOTFOUND is logical, opposite of the %FOUND. The %NOTFOUND yields FALSE if the last fetch returned a row, or TRUE when the final fetch failed to return a row. I