Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 A lying linked server message

Author  Topic 

Cattrah
Starting Member

13 Posts

Posted - 2008-06-23 : 10:23:27
I'm executing a procedure over a linked server to an oracle database and I just added three output variables to it. When I run the statement, Sql server throws me the following message:

Msg 7215, Level 17, State 1, Line 29
Could not execute statement on remote server 'PTM_TO_EMPAC'.

BUT, the weird thing is, it executed perfectly on the linked server and I can see the results of the procedure having run. Why is Sql server lying to me? Is it because it couldn't finish the procedure and put the output values from the procedure into my output variables and that's where its crashing? I've run the same procedure before without the output variables and I don't get this message. Here's how I am passing the variables, I assume this is correct. Should I look into the oracle procedure and have it send the output values back in a different way?

execute('begin EMPAC.INT_PTM.CreateWorkOrder(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?); commit; end;', '36', @AssetNo, @Requestor, @ProbDesc, @WOAStatus, @Priority, @DateReq, '000000001', @WorkDesc, @Crew, @Craft, @Shutdown, @PlanType, '000000001', @Hours, @Persons, @WONumber output, @PassFail output, @Errormsg output) AT PTM_TO_EMPAC;
   

- Advertisement -