Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Ho to insert no. of records at a time..i mean i want to
insert 100 records at a time into a table

Answer Posted / ron

i assume you are doing batch processing (say processing of
millions of rows):
1. add a new column to the table say t2 called
processed_rows char(1) not null default of 'N'
2. in a pl/sql block (start loop);
update processed columns to 'P' for processing
where rownum<101;
2. if rowcount after update=0 exit loop.
3. next insert into t1 select from t2 where processed_rows='P'
4. update t2 change column from 'P' to 'Y (saying processed)
6 commit;
7. loop until all rows are processed.
8. advantages. you can restart the process after failure.
and done have to start all over again only those that that
have not been processed will be processed.

to improve performance is millions of rows are being
processed then:
partition the table table;
and run the above sql against each individual partitions;
processing will be done that many times faster.

good luck!

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the characteristics of oracle dba?

1069


How to define a data field as not null?

1061


What is an oracle data file?

1039


What are the different types of partitions in oracle?

911


What is meant by joins? List out the types of joins.

959


Explain database link?

1062


How remove data files before opening a database?

997


How to shutdown your 10g xe server from command line?

1015


what is port in oracle? how is it related to database application.

1895


How many types of database triggers exist?

1068


How to select some columns from a table in oracle?

1005


Using the relations and the rules set out in the notes under each relation, write table create statements for the relations EMPLOYEE, FIRE and DESPATCH. You should aim to provide each constraint with a formal name, for example table_column_pk.

1795


How to use "for" statements in oracle?

1018


How do I spool in oracle?

939


definition of cluster and non-clustered index?

2961