Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Mysql Stored Procedure

Posted on 2009-07-14
1
Medium Priority
?
643 Views
Last Modified: 2013-12-13
Hi,
I have a stored procedure to run sql statement. And i have passed a create procedure sql statement throught parameters but there is raise syntax error. What can i do?
ps: I use sqlyoq mysql client program
//this is my sp for execute sql statements.
DELIMITER $$
CREATE PROCEDURE `ExecuteSql`(
	IN pSql TEXT)
BEGIN
	SET @ssql=pSql;
	PREPARE stmt FROM @ssql;
	EXECUTE stmt;
END$$
DELIMITER ;
/************************//
 
 
/*problem is here, i call ExecuteSql sp from sql yoq */
CALL ExecuteSql('DELIMITER $$
                              CREATE PROCEDURE TestSp()
                               BEGIN
                               	SELECT \'This is a test\';
                             END$$
                             DELIMITER ;');
 
error is here: You have an error in your SQL syntax;....

Open in new window

problem.jpg
0
Comment
Question by:erenpasa
1 Comment
 
LVL 14

Accepted Solution

by:
flob9 earned 2000 total points
ID: 24847883
Tried this :

CALL ExecuteSql('CREATE PROCEDURE TestSp()
                 BEGIN
                 SELECT \'This is a test\';
                 END');

But you will get this :
"This command is not supported in the prepared statement protocol yet"
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, we’ll look at how to deploy ProxySQL.
What we learned in Webroot's webinar on multi-vector protection.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

876 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question