Data synchronization between Oracle data tables

Source: Internet
Author: User

Ensure two data table structure is the same, if not the same can only synchronize the same field;

Just the idea, please modify according to the requirements.

Declare        cursorCsrn_mon is          Select *        fromtable2; Row_mon Csrn_mon%RowType;cursorCsrn_loc isSelect *  fromTable1;row_loc Csrn_loc%RowType;cursorCsrn_del isSelectXh fromTable1 minusSelectXh fromTable2;row_del Csrn_del%RowType;cursorCsrn_ins isSelectXh fromTable2 minusSelectXh fromtable1;row_ins csrn_ins%RowType;begin             forRow_moninchCsrn_mon Loop forRow_locinchCsrn_loc LoopifRow_loc.xh=Row_mon.xh ThenDbms_output.put_line ('Update information:' ||row_loc.xh); End if; EndLoop;EndLoop; forRow_delinchCsrn_del Loop Dbms_output.put_line ('Delete Information:' ||row_del.xh);EndLoop; forRow_insinchCsrn_ins Loop Dbms_output.put_line ('Insert Information:' ||row_ins.xh);EndLoop;End;

Data synchronization between Oracle data tables

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.