Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> inaccurate sql%rowcount
I am using sql%rowcount to track the success of a string of database transactions as follows:
select from table...
dbms_output.putline('select '||sql%rowcount)
call procedure (this is an autonomous transaction) that inserts a
record into a test table...
dbms_output.putline('result '||sql%rowcount)
insert table...
dbms_output.putline('insert '||sql%rowcount)
call procedure (this is an autonomous transaction) that inserts a
record into a test table...
dbms_output.putline('result '||sql%rowcount)
update table...
dbms_output.putline('update '||sql%rowcount)
update another table...
dbms_output.putline('update '||sql%rowcount)
call procedure (this is an autonomous transaction) that inserts a
record into a test table...
dbms_output.putline('result '||sql%rowcount)
delete from table ...
dbms_output.putline('delete '||sql%rowcount)
Everything seems OK except for the last rowcount for the delete. Even when the delete fails, the delete rowcount value comes back as 1. If I comment out both the second update and the last call to procedure, the delete rowcount is correct (equal to zero). If I only comment out one or the other, the delete rowcount is incorrect. What is going on???
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Fri Aug 04 2000 - 00:00:00 CDT