SQL 7: Problems w/ insert query on Oracle 8 linked server from trigger

SQL 7: Problems w/ insert query on Oracle 8 linked server from trigger

Post by Ryan Ma » Thu, 22 Apr 1999 04:00:00



I have a linked server connection to an Oracle 8 server from SQL 7
established, and I can run all kinds of queries on the linked server
just fine from the Query Analyzer.

What I need to do, however, is an insert query on the linked server from
within a trigger.  When I try an insert query inside the trigger, I get
the following message:

Server: Msg 7399, Level 16, State 1, Procedure insMY_TABLE, Line 6
OLE DB provider 'MSDAORA' reported an error.
[OLE/DB provider returned message: Unspecified error]
[OLE/DB provider returned message: An Oracle Error occured, but message
could not be determined]

I am using 4-part names for the insert query ( i.e. INSERT INTO
OracleServer..Schema.Table).  I noted also that when the query is run
from inside the trigger, it goes through MSDTC--I can watch it abort
from the MSDTC Administrative Console.

I'm guessing that the the environment the query is running in from
inside the trigger is different than the one that Query Analyzer gives
me, which is why it's working in one place and not in another.  I'm not
quite sure where to start looking for problems (a slightly more
informative error message might have helped!), so if anyone has had
similar problems, or has experience with this kind of thing, I would
appreciate any help or insights you might have.

---------
Ryan May
Systems Coordinator
Xactware, Inc.

 
 
 

SQL 7: Problems w/ insert query on Oracle 8 linked server from trigger

Post by Tibor Karasz » Fri, 23 Apr 1999 04:00:00


Ryan,

I don't have an answer for you, but possibly "narrow down your search path".

I can only assume that SQL Server need to do the INSERT inside a distributed
transaction when it is executed through a trigger. The code in a trigger is
"protected" by a transaction automatically. The call to MSDTC seem to
confirm it.

In order for this to work, the OLEDB provider has to support
ITransactionJoin. Check out doc's for your OLEDB provider if it supports
that interface.

You might need a transaction monitor at the other end (just as you use MSTDC
at your end), but I'm not sure about this.

You can search Books Online for "ITransactionJoin", and find some reading.
There might be some KB articles as well..
--
Tibor Karaszi
MCSE, MCSD, MCT, SQL Server MVP
Cornerstone Sweden AB
Please do not respond by e-mail unless explicitly asked for.


>I have a linked server connection to an Oracle 8 server from SQL 7
>established, and I can run all kinds of queries on the linked server
>just fine from the Query Analyzer.

>What I need to do, however, is an insert query on the linked server from
>within a trigger.  When I try an insert query inside the trigger, I get
>the following message:

>Server: Msg 7399, Level 16, State 1, Procedure insMY_TABLE, Line 6
>OLE DB provider 'MSDAORA' reported an error.
>[OLE/DB provider returned message: Unspecified error]
>[OLE/DB provider returned message: An Oracle Error occured, but message
>could not be determined]

>I am using 4-part names for the insert query ( i.e. INSERT INTO
>OracleServer..Schema.Table).  I noted also that when the query is run
>from inside the trigger, it goes through MSDTC--I can watch it abort
>from the MSDTC Administrative Console.

>I'm guessing that the the environment the query is running in from
>inside the trigger is different than the one that Query Analyzer gives
>me, which is why it's working in one place and not in another.  I'm not
>quite sure where to start looking for problems (a slightly more
>informative error message might have helped!), so if anyone has had
>similar problems, or has experience with this kind of thing, I would
>appreciate any help or insights you might have.

>---------
>Ryan May
>Systems Coordinator
>Xactware, Inc.


 
 
 

1. starting a stored procedure which is inserts data into a linked oracle server from a trigger

Hi!

I would like to start a stored procedure which is intesrts data into a
linked oracle server from a trigger,
the problem is that the trigger starts a transaction and I receive the
following error:
"The operation could not be performed because the OLE DB provider 'MSDAORA'
was unable to begin a distributed transaction."
Any idea, how to solve this problem?
 If I run the procedure without begining a transaction, it's working, but I
have to run form a trigger which is starts a transaction ..

We use sql server 2000 sp2.

Thanks!

B.B.

2. console log / UNIX

3. Insert trigger to linked SQL server fails

4. showing available time from a table

5. Problem querying a linked Oracle server from SQL 2000

6. Connecting to databse from ASP ??

7. Problem inserting into DB2 from SQL Server via Linked Server

8. Faxing from Informix running under SCO 4.3v2.3

9. Linked-Server (Trigger in a Trigger Problem)

10. SQL Server Trigger - MQ SQL Linked Server Table

11. insert trigger into linked server DB not working

12. Insert to a linked server fails in a trigger

13. insert Trigger into linked server not working