SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Calling MySQL stored procedures viua a linked server


Calling MySQL stored procedures viua a linked server

Author
Message
dJeePe
dJeePe
SSC-Enthusiastic
SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)

Group: General Forum Members
Points: 110 Visits: 2385
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.
SQL ORACLE
SQL ORACLE
SSCrazy
SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)

Group: General Forum Members
Points: 2665 Visits: 1314

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]?


dJeePe
dJeePe
SSC-Enthusiastic
SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)

Group: General Forum Members
Points: 110 Visits: 2385
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?
dJeePe
dJeePe
SSC-Enthusiastic
SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)

Group: General Forum Members
Points: 110 Visits: 2385
Cracked it!

EXEC('CALL usp_test') AT MYSQLLOCALHOST
Jo Pattyn
Jo Pattyn
SSCrazy
SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)

Group: General Forum Members
Points: 2780 Visits: 9901
Interesting solution.
jie_yuan
jie_yuan
Forum Newbie
Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)

Group: General Forum Members
Points: 7 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.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search