?
Solved

Mysql Stored Procedure

Posted on 2009-07-14
1
Medium Priority
?
642 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 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

In this blog post, we’ll look at how using thread_statistics can cause high memory usage.
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
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…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

719 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