Increment at counter

From: Allan Martin <allan.martin_at_saic.com>
Date: Wed, 24 Oct 2001 17:01:48 +0100
Message-ID: <3bd6837c_at_cpns1.saic.com>



Hi,
[Quoted] [Quoted] I'm trying to insert into a number variable the amount of records that I insert into a table. ie. I want to increment the counter by 1 every time a row is inserted. I'd then display the amount at the end.

I have tried this over and over again and have even bought a book from AMAZON to help me in the future.

Does anyone know what to do as my book will take more that 20 days to arrive from
America?

[Quoted] I've got what I had in mind below.

Thanks a lot,
Allan

DECLARE [Quoted]     v_counter NUMBER := 0;

BEGIN  insert into tbl1

        (v1,
         v2,
         v3)
[Quoted]   select distinct
         v1,
         v2,
         v3
--        v_counter = v_counter + 1;

  from theTable;

  commit;

[Quoted] [Quoted]   dbms_output.put_line('1. || v_counter || ' records inserted.');

END;
/ Received on Wed Oct 24 2001 - 18:01:48 CEST

Original text of this message