Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> inaccurate sql%rowcount

inaccurate sql%rowcount

From: <aowens2325_at_my-deja.com>
Date: 2000/08/04
Message-ID: <8mf5km$7vu$1@nnrp1.deja.com>#1/1

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US