%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
EXCEPTION_INIT Pragma The pragma EXCEPTION_INIT relates an exception name with an Oracle error number. Which allow you to refer to any internal exception by the name and to wri

Question: a) Given the following relation: Location(loc_id, bldg_code, room, capacity) The underlined field is a primary key. (i) Write a PL/SQL program using the impl

Predicate - SQL Consider the declarative sentence-a proposition-that is used to introduce this topic:  "Student S1, named Anne, is enrolled on course C1." Recall that th

DBMS_PIPE: The Package DBMS_PIPE allows various sessions to communicate over the named pipes. (A pipe is a region of memory used by one of the process to pass information to

I have a Pascal Source file that needs to be compiled into a Service. In addition, there are various functions (Pascal Procedures I guess) that need to be created to Read and Write

How Exceptions Are Raised By the run-time system, the internal exceptions are raised implicitly as are user-defined exceptions that you have related with an Oracle error number

Block Structure The PL/SQL is a block-structured language. That is, the fundamental units (procedures, anonymous blocks, and functions) that make up a PL/SQL program are logi

What are 3 good practices of modeling and/or implementing data warehouses?

Constants and Variables:   You can declare the constants and variables in the declarative section of any PL/SQL subprogram, block, or package. The Declarations allot the stor

Positional and Named Notation You can write the actual parameters when calling a subprogram, using either positional or named notation. That is, you can point to the relationsh