%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
Project Description: I want a database for large governmental and private data sets on one country that will be easily extended to other countries in the future. Also, the datab

Cursor Variables As Parameters You can declare the cursor variables as the formal parameters of the functions and procedures. In the illustration below, you define the REF CUR

DECLARE : This keyword signals the beginning of the declarative section of the PL/SQL block, that contains local declarations. The Items declared locally exist only within the

Manipulating Individual Elements Faraway you have manipulated an entire collection. Within the SQL, to manipulate the individual elements of the collection, and then use the ope

Write a pl/sql block that declares and uses cursors with parameters. In a loop, use a cursor to retrieve the department number and the department name from the departments table

Entering and Exiting If you enter the executable part of an autonomous routine, the major transaction suspends. When you exit the routine, the major transaction resumes. To ex

Defining Autonomous Transactions To define an autonomous transaction, you use the pragma (compiler directive) AUTONOMOUS_TRANSACTION. The pragma instructs the PL/SQL compiler

Example of NOT EXISTS Operator - SQL Example is a translation into SQL of the corresponding example, which is included there merely to show that for any scalar comparison the

"Not Enforced" Table Constraints A constraint that is not enforced is not really a constraint within the meaning of the act, but SQL does have such a concept and it needs to b

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