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
Can we create trigger on materialized view in oracle?
How to list all indexes in your schema?
Can you tell me how to add new column in existing views?how?How is possible?
I have a parent program and a child program. I want to write a statement in Exception Block of the parent program so that when the statement in the exception block is executed, the control goes to the next statement in the parent block bypassing the child block.How do i do that?
How to drop a stored function?
Can we convert a date to char in oracle and if so, what would be the syntax?
Can we store images in oracle database?
I creat Credit memo in AR. Now i want revers the Credit Memo.how you can revers that what out any aditional entry.
Please explain oracle left join with an example?
What are nested tables?
What are the most common interview questions on ETL Testing for experience?
What are data pump export and import modes?
How to rename an index in oracle?
What is truncate oracle?
How to select all columns of all rows from a table in oracle?