Solved

Mysql Stored Procedure

Posted on 2009-07-14
1
636 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 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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

These days socially coordinated efforts have turned into a critical requirement for enterprises.
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

786 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