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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Increment at counter

Re: Increment at counter

From: GREGORY KNESER <gregoryk_at_futures.wharton.upenn.edu>
Date: 24 Oct 2001 16:21:31 GMT
Message-ID: <9r6pqb$sp$2@netnews.upenn.edu>


How about the following, though it is slow.

Changes below:

Allan Martin (allan.martin_at_saic.com) wrote:
: DECLARE

: v_counter NUMBER := 0;

cursor test_cursor is
select distinct v1, v2, v3 from the table;

: BEGIN
for each_rec in test_cursor loop

: insert into tbl1 values
: (each_rec.v1,
: each_rec.v2,
: each_rec.v3);

        v_counter := v_counter+1

        end loop;
: commit;

: dbms_output.put_line('1. || v_counter || ' records inserted.');

: END;
: /
Received on Wed Oct 24 2001 - 11:21:31 CDT

Original text of this message

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