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: How many records do I commit after insert?

Re: How many records do I commit after insert?

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Thu, 08 Oct 1998 16:20:59 GMT
Message-ID: <361de663.7321607@192.86.155.100>


A copy of this was sent to violin.hsiao_at_mail.pouchen.com.tw (Violin) (if that email address didn't require changing) On Thu, 08 Oct 1998 02:25:38 GMT, you wrote:

>Hello,
>Does any way to know how many records after insert and commit?
>Ex.
> insert into table1 (col1,col2,col3) (select * from table2);
> insert into table1 (col1,col2,col3) (select * from table3);
> insert into table1 (col1,col2,col3) (select * from table4);
> commit;
>
>I want to know how many records I will commit.
>Please give me some tips.
>Thank you in advance.
>
>Violin.
>violin.hsiao_at_mail.pouchen.com.tw

Here is one way to do it:

create table x as select * from all_users where rownum=0;

declare

    l_cnt number;
begin

    insert into x select * from all_users;     l_cnt := sql%rowcount;
    insert into x select * from all_users;     l_cnt := l_cnt+sql%rowcount;
    insert into x select * from all_users;     l_cnt := l_cnt+sql%rowcount;
    commit;

    dbms_output.put_line( ' you commited ' || l_cnt || ' records...' ); end;
/  

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Herndon VA

--
http://govt.us.oracle.com/ -- downloadable utilities  



Opinions are mine and do not necessarily reflect those of Oracle Corporation  

Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Thu Oct 08 1998 - 11:20:59 CDT

Original text of this message

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