%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
Explicit Cursors The set of rows returned by the query can include zero, one, or multiple rows, depending on how many rows meet your search criteria. Whenever a query returns

PITS Depressions in secondary cell wall is called pit. A pit present on the free cell wall surface without its partner is called Blind pit. It consists of 2 parts -

The Package Specification The package specifications contain the public declarations. The scopes of these declarations are local to your database representation and global to t

IS NULL Operator The IS NULL operator returns the Boolean value TRUE whenever its operand is null or FALSE if it is not null. The comparisons including the nulls always yield NU

INSERT Command in SQL Loosely speaking, INSERT takes the rows of a given source table and adds them to the specified target table, retaining all the existing rows in the targ

Using %TYPE The %TYPE attribute gives the datatype of a variable or the database column. In the example below, the %TYPE gives the datatype of a variable: credit REAL(7,2); debi

Built-In Functions The PL/SQL provides a lot of powerful functions to help you to manipulate the data. These built-in functions fall into the categories as shown below: error r

Special cases of projection This section describes the identity projection, r {ALL BUT}, and the projection on no attributes, r { }, which yields TABLE_DUM when r is empty, ot

Project Description: This is stage 1 of a larger conversion project. We are converting a traditional Server/Client application written in Access 2007 into a web interface with S

Bulk Fetching The illustration below shows that you can bulk-fetch from a cursor into one or more collections: DECLARE TYPE NameTab IS TABLE OF emp.ename%TYPE; TYPE S