Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Increment at counter
Hi,
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?
I've got what I had in mind below.
Thanks a lot,
Allan
DECLARE v_counter NUMBER := 0;
BEGIN insert into tbl1
(v1, v2, v3) select distinct v1, v2, v3 -- v_counter = v_counter + 1;
commit;
dbms_output.put_line('1. || v_counter || ' records inserted.');
END;
/
Received on Wed Oct 24 2001 - 11:01:48 CDT
![]() |
![]() |