Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Calling MySQL stored procedures viua a linked server Expand / Collapse
Author
Message
Posted Wednesday, August 1, 2007 6:47 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Wednesday, March 19, 2008 1:05 AM
Points: 82, Visits: 2,385
Does anyone know if it is possible to call MySQL stored procedures via a linked server setup? I've searched around the net and had a play myself but have had no luck so far.
Post #386957
Posted Wednesday, August 1, 2007 2:43 PM
UDP Broadcaster

UDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP Broadcaster

Group: General Forum Members
Last Login: Friday, April 5, 2013 4:43 PM
Points: 1,473, Visits: 1,314

When you ran a stored procedure on a remote heterogeneous data server, did you include full name of the stored procedure, such as [ServerName].[DBName].[Owneship].[StoredProcedure]?

Post #387174
Posted Thursday, August 2, 2007 2:14 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Wednesday, March 19, 2008 1:05 AM
Points: 82, Visits: 2,385
EXEC MYSQLLOCALHOST.rhys.root.usp_test

/*------------------------
EXEC MYSQLLOCALHOST.rhys.root.usp_test
------------------------*/
OLE DB provider "MSDASQL" for linked server "MYSQLLOCALHOST" returned message "[MySQL][ODBC 3.51 Driver][mysqld-5.0.41-community-nt]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?=call "rhys"."root"."usp_test";1' at line 1".
Msg 7212, Level 17, State 1, Line 1
Could not execute procedure 'usp_test' on remote server 'MYSQLLOCALHOST'.


I've tried the above and so many variations. Is there a way of passing a string (or sql) directly for the linked server to execute?
Post #387278
Posted Thursday, August 2, 2007 2:35 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Wednesday, March 19, 2008 1:05 AM
Points: 82, Visits: 2,385
Cracked it!

EXEC('CALL usp_test') AT MYSQLLOCALHOST
Post #387286
Posted Friday, August 3, 2007 12:59 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Today @ 8:15 PM
Points: 1,389, Visits: 6,310
Interesting solution.
Post #387645
Posted Wednesday, April 17, 2013 3:24 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, September 13, 2013 1:41 PM
Points: 1, Visits: 89
Is there a way to get the value ( i.e. @rtn_cd) of the OUT varialbe in mysql stored procedure in MSSQL like the following ?

EXEC('CALL usp_test(@rtn_cd)' ) AT MYSQLLOCALHOST

If mysql procedure is created like this:

create procedure usp_test(OUT return_code int)
begin

..

end;

Thanks in advance.
Post #1443507
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse