-----------------------------------------------------------------------------
FOR x in 1..remove_column.count loop
dbms_output.put_line('remove_column('||x||')='||remove_column(x));
rowlcr.DELETE_COLUMN(remove_column(x),'old');
END loop;
rowlcr.EXECUTE(true);
DBMS_OUTPUT.PUT_LINE('DELETE target old new ');
--- INSERT NEW DATA--
rowlcr.SET_COMMAND_TYPE('INSERT');
rowlcr.SET_VALUES('new',old_values);
rowlcr.SET_VALUES('old',NULL);
rowlcr.EXECUTE(true);
DBMS_OUTPUT.PUT_LINE('insert source old new');
END IF;
BEGIN
--dbms_apply_adm.execute_all_errors(applyname);
dbms_apply_adm.EXECUTE_ERROR(ltxnid);
return;
EXCEPTION when OTHERS then
SELECT MESSAGE_NUMBER INTO i FROM DBA_APPLY_ERROR WHERE LOCAL_TRANSACTION_ID = ltxnid;
v_code := SQLCODE;
v_errm := SUBSTR(SQLERRM, 1, 1024);
DBMS_OUTPUT.PUT_LINE('Error message: ' || v_errm);
IF loopdog > msgcnt then
RAISE_APPLICATION_ERROR(-20002,'Insert or Delete error. please check your procedure.');
ELSIF v_code = -26786 then
DBMS_OUTPUT.PUT_LINE('Error code(-26786): ' || v_code);
ELSIF v_code = -26787 then
DBMS_OUTPUT.PUT_LINE('Error code(-26787): ' || v_code);
RAISE_APPLICATION_ERROR(-20787,v_errm);
ELSIF v_code = -1 then
DBMS_OUTPUT.PUT_LINE('Error code(-1): ' || v_code);
RAISE_APPLICATION_ERROR(-20001,v_errm);
ELSE
RAISE_APPLICATION_ERROR(-20000,v_errm);
END IF;
END;
END IF;
END LOOP;
END EXECUTE_TRANSACTION_26786;
ORA-26786 思想与 ORA-00001 思想类似, 不再赘述.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------