Replicate Remote tables to look and insert the update changes
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: Replicate Remote tables to look and insert the update changes

  1. #1
    Join Date
    Mar 2006
    Posts
    5

    Replicate Remote tables to look and insert the update changes

    My Question is about remote replication so can keep checking on remote tables what has been changed. Is there is any way to do it by CURSORS.

    NOTE: nothing can be added in remote tables as it is private.

    OR

    I have used this mechanism to check for updated changes
    SELECT * FROM remote.tables
    MINUS
    SELECT * FROM user_tables

    where i can get the tables for update changes but now after getting these tables i want to insert them in user_tables. How can this be implemented.

    NOTE: I cannot use triggers on remote tables

    I really need help as i am stucked and is last part of my replication assignment.

    I have to use replication script to look for updated changes in my follwing PL/SQL script.
    *********************************
    CURSOR c1 is
    SELECT table_name FROM all_tables WHERE dropped = 'NO' and owner = 'BRENDAN';
    CURSOR c2 Is
    Select table_name FROM user_tables where dropped = 'NO';
    sql_stmt varchar2(200);


    BEGIN
    FOR rec1 IN c1 LOOP
    v_tablename := rec1.table_name;
    for rec2 in c2 loop
    if rec2.table_name = (rec1.table_name || '_COPY') then
    v_tableExists := true;
    end if;

    END LOOP;
    if v_tableExists = false then
    execute immediate 'create table ' || v_tablename || '_COPY as select * from brendan.' || v_tablename;
    END IF;
    END LOOP;
    END;

  2. #2
    Join Date
    Jun 2000
    Location
    Madrid, Spain
    Posts
    7,447
    homework

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width