ORA-02047: cannot join the distributed transaction in progress [message #578812] |
Tue, 05 March 2013 07:15 |
|
sakamboh
Messages: 24 Registered: March 2013 Location: oman
|
Junior Member |
|
|
Hellow All,
I am trying to create dblink from oracle11GR2@linux to sql using easysoft odbc driver.
DBlink is successfull, i am able to use insert statements in SQL.
I want to insert in SQL database table whenever their is a insert in Oracle Table,I have wrote a triger for this,but i am having an issues on inserting in Oracle Table.I wrote the trigger as below.
create or replace
TRIGGER trig_tbluser1
after INSERT OR UPDATE OR DELETE ON TBLUSERPREFERENCE1
FOR each ROW
BEGIN
IF inserting THEN
INSERT INTO tbluser@hslink
VALUES
(
:NEW.userid,:NEW.password,:NEW.username
);
ELSIF updating THEN NULL;
ELSIF deleting THEN NULL;
END IF;
END;
Now when i am executing insert statement, i am getting the below error,
SQL> Insert into TBLUSERPREFERENCE1 (USERID,PASSWORD,USERNAME) values ('123','abcd','bceef');
Insert into TBLUSERPREFERENCE1 (USERID,PASSWORD,USERNAME) values ('123','abcd','bceef')
*
ERROR at line 1:
ORA-02047: cannot join the distributed transaction in progress
ORA-06512: at "IRIS.TRIG_TBLUSER1", line 3
ORA-04088: error during execution of trigger 'IRIS.TRIG_TBLUSER1'
Can anyone assist me solving the issue. Your urgent help is required.
|
|
|
|
|
|
|
|
|
|
Re: ORA-02047: cannot join the distributed transaction in progress [message #580725 is a reply to message #578862] |
Wed, 27 March 2013 09:30 |
|
sakamboh
Messages: 24 Registered: March 2013 Location: oman
|
Junior Member |
|
|
Hello All,
I contacted easysoft for two way commit, their driver doesnot support two commit. They said you can use it as below code.
DECLARE c NUMBER; n NUMBER;
BEGIN
c := DBMS_HS_PASSTHROUGH.OPEN_CURSOR@odbc;
DBMS_HS_PASSTHROUGH.PARSE@odbc(c,'insert into insert_performance_test values
( 1, ''This is data insert test 1''),
( 2, ''This is data insert test 2''),
( 3, ''This is data insert test 3'')');
n := DBMS_HS_PASSTHROUGH.EXECUTE_NON_QUERY@odbc (c);
DBMS_HS_PASSTHROUGH.CLOSE_CURSOR@odbc(c);
END;
/
I am not able to achieve my required output using the given example... Anyone can guide me plz...
I looking for solution without using PRAGMA AUTONOMOUS_TRANSACTION.
|
|
|