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

How do I use os authentication with weblogic jdriver for oracle and connection pools?

568


What are the limitations oracle database 10g xe?

568


What is a initialization parameter file in oracle?

577


Is there any function in oracle similar like group_concat of mysql?

535


How to find out what oracle odbc drivers are installed?

568






How to execute a stored program unit?

578


What is the difference between substr & instr functions?

595


Explain enable novalidate constraint.

593


How to put more than 1000 values into an oracle in clause?

581


What is the difference between translate and replace in oracle?

645


What is different types of joins?

570


What is a data lock in oracle?

605


How to convert csv to table in oracle?

522


1) Does oracle have any table which contain all the exceptions and it's code internally?

1280


Difference between hot backup vs. Cold backup?

602