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 -> Re: Getting a count on the number of affect rows

Re: Getting a count on the number of affect rows

From: GHouck <hksys_at_teleport.com>
Date: Mon, 28 Sep 1998 23:26:16 GMT
Message-ID: <36101B15.6FFF@teleport.com>


danalynn_at_my-dejanews.com wrote:
>
> Hello,
>
> I was wondering if there is a way to get the number of rows affected by a SQL
> (insert/update) command (not in PL/SQL). I know you can use @@rowcount in
> MSSQL, is there a similar variable in Oracle that I can use?
>
> Thanks.
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum

You could create a Trigger that simply counts in separate table when the table of interest experiences an INSERT or UPDATE.

Something like:

CREATE TABLE MYTABLE_COUNTER ( COUNTER ); CREATE OR REPLACE TRIGGER MYTABLE_COUNTER BEFORE UPDATE ON MYTABLE
FOR EACH ROW
BEGIN
UPDATE MYTABLE_COUNTER SET COUNTER=COUNTER+1; END; Probably not the most efficient method though, but relatively simple.

Yours,

Geoff Houck
systems hk
hksys_at_teleport.com
http://www.teleport.com/~hksys Received on Mon Sep 28 1998 - 18:26:16 CDT

Original text of this message

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