About Oracle Batch processing data

Source: Internet
Author: User

It is too slow to update the data with a cursor, and after a series of queries in the same table is deleted, the insertions are likely to be overloaded, so it is important to process the data in batches, and here are some of the functional operations of a small number of stored procedures that I write in the project. The main implementation is to add the number of similar data and reinsert the data, remove the rest of the duplication of data, nonsense, the code

Begin
--v_step: = 5;
INSERT INTO T_bu_future_order_ei_tmp
(Factory_code,
Ei_code,
Car_type_code,
Produce_date,
Capacity,
MODIFIER)
Select Factory_code,
Ei_code,
Car_type_code,
Produce_date,
SUM (t.capacity),
' Sum '
From T_bu_future_order_ei_tmp T
where 1 = 1
Group by Factory_code, Ei_code, Car_type_code, produce_date;
End
Begin
Delete T_bu_future_order_ei_tmp T
where t.modifier! = ' Sum ';
End

About Oracle Batch processing data

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.