Home » SQL & PL/SQL » SQL & PL/SQL » Bulk Insert (Oracle 10g)
Bulk Insert [message #342296] Thu, 21 August 2008 23:39 Go to next message
subbu_tce
Messages: 98
Registered: July 2007
Location: pune
Member
Declare
Type numType Is Table of Number Index By Binary_Integer;
numTypeObj numType;
Begin
For Rec In 1..10 Loop
numTypeObj(Rec):=Rec;
End Loop;
Forall Rec In 1..10
Insert into emp (empno) Values (numTypeObj(Rec));
Dbms_output.put_line(sql%Bulk_rowcount(1));
End;

The output will be 1.
How to find that how many rows are inserted into the table?.
Re: Bulk Insert [message #342297 is a reply to message #342296] Thu, 21 August 2008 23:42 Go to previous messageGo to next message
BlackSwan
Messages: 25036
Registered: January 2009
Location: SoCal
Senior Member
http://www.orafaq.com/forum/t/88153/0/
Please read & FOLLOW the Posting Guidelines as stated in URL above


>How to find that how many rows are inserted into the table?.
Count them?
Re: Bulk Insert [message #342316 is a reply to message #342296] Fri, 22 August 2008 00:34 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
sql%rowcount

Regards
Michel
Re: Bulk Insert [message #342321 is a reply to message #342316] Fri, 22 August 2008 00:39 Go to previous messageGo to next message
BlackSwan
Messages: 25036
Registered: January 2009
Location: SoCal
Senior Member
Michel Cadot wrote on Thu, 21 August 2008 22:34
sql%rowcount

Regards
Michel



How does this apply within LOOP as stated previously?
Re: Bulk Insert [message #342323 is a reply to message #342321] Fri, 22 August 2008 00:43 Go to previous message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Ana, I don't understand your question; it was just an answer to "How to find that how many rows are inserted into the table?".
SQL> Declare
  2  Type numType Is Table of Number Index By Binary_Integer;
  3  numTypeObj numType;
  4  Begin
  5  For Rec In 1..10 Loop
  6  numTypeObj(Rec):=Rec;
  7  End Loop;
  8  Forall Rec In 1..10
  9  Insert into emp (empno) Values (numTypeObj(Rec));
 10  Dbms_output.put_line(sql%rowcount);
 11  end;
 12  /
10

PL/SQL procedure successfully completed.

Regards
Michel
Previous Topic: Each employee with Manager select
Next Topic: Dynamic Sql
Goto Forum:
  


Current Time: Sun Dec 04 16:54:24 CST 2016

Total time taken to generate the page: 0.05335 seconds