Moving XML over a DBLink

后端 未结 5 1931
不知归路
不知归路 2021-01-22 17:24

I am trying to move some data over a dblink and one of the columns is an XMLType column. The code looks like this:

begin
    delete from some_schema.some_remote_         


        
5条回答
  •  Happy的楠姐
    2021-01-22 18:27

    Instead Perform a Data PULL.

    1. create the data pull procedure at Remote database B.
    2. create synonyms and provide grants to the dblink user.
    3. Call the Remote procedure from Database A (Source) Perform a commit at Database A(source).

    (Meanwhile .. wait for oracle to find some solution to perform the PUSH of XML over dblink in the future)

    Create a procedure at Remote site Database B

    CREATE OR REPLACE PROCEDURE PR_REMOTE(OP_TOTAL_COUNT OUT NUMBER) IS
    BEGIN
    
      INSERT /*+ DRIVING_SITE(src) */
      INTO REMOTE_TABLE TGT_B
        (XMLDATA_COL)
        SELECT SRC.XMLDATA FROM LOCAL_TABLE@TGT2SRC_DBLINK SRC;
    
      OP_TOTAL_COUNT := SQL%ROWCOUNT;
    
    END;
    

    Call the procedure from Database A

    DECLARE
      V_COUNT NUMBER := 0;
    BEGIN
      PR_REMOTE(V_COUNT);
      COMMIT;
    END;
    

提交回复
热议问题