Home » SQL & PL/SQL » SQL & PL/SQL » setting SQL%ROWCOUNT in stored procedure
setting SQL%ROWCOUNT in stored procedure [message #283649] Tue, 27 November 2007 17:12 Go to next message
Messages: 9
Registered: November 2007
Junior Member
Anyone know if there's a way to manually set the value of SQL%ROWCOUNT?

I have a stored procedure that is called to update several rows of a table - but they are updated serially. The procedure is called from an OCI program that thinks the stored procedure call is an update statement - and thus it checks SQL%ROWCOUNT to see how many rows were updated. I cannot make any changes to the OCI program.

So, to get the OCI program to accurately know how many rows were updated, I need to find a way to manipulate SQL%ROWCOUNT from within the stored procedure call.

Any ideas?
Re: setting SQL%ROWCOUNT in stored procedure [message #283650 is a reply to message #283649] Tue, 27 November 2007 17:53 Go to previous message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
n :=0;

-- running total
n:= n + sql%rowcount;

update my_dummy_table set x=x where rownum <= n;

if sql%rowcount != n then
end if;

[Updated on: Tue, 27 November 2007 18:07]

Report message to a moderator

Previous Topic: Declare date and BEGIN problem
Next Topic: Date as column header and below result
Goto Forum:

Current Time: Sun Aug 20 23:52:45 CDT 2017

Total time taken to generate the page: 0.10498 seconds