Solved

Mysql Stored Procedure

Posted on 2009-07-14
1
639 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 14

Accepted Solution

by:
flob9 earned 500 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

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

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

Suggested Solutions

A company’s centralized system that manages user data, security, and distributed resources is often a focus of criminal attention. Active Directory (AD) is no exception. In truth, it’s even more likely to be targeted due to the number of companies …
In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

738 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