HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

Negative number of rows inserted

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
rowsnumbernegativeinserted

Problem

I just ran a rather simple INSERT statement (that I think processed a lot of rows), and I got the message:


-1,311,750,183 rows inserted

Should I be concerned about the fact that it's negative?

Solution

It is possible that the number of rows exceed the value of PLS_INTEGER. Here is the quote from Oracle on %ROWCOUNT.


%ROWCOUNT Attribute: How Many Rows Were Fetched? %ROWCOUNT returns:
Zero after the explicit cursor is opened but before the first fetch
Otherwise, the number of rows fetched (a PLS_INTEGER)
Note:
If the number of rows exceeds the maximum value for a PLS_INTEGER, then SQL%ROWCOUNT returns a negative value. For information about
PLS_INTEGER, see "PLS_INTEGER and BINARY_INTEGER Data Types".

Context

StackExchange Database Administrators Q#46186, answer score: 5

Revisions (0)

No revisions yet.