Solved

Mysql Stored Procedure

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

These days socially coordinated efforts have turned into a critical requirement for enterprises.
This article discusses four methods for overlaying images in a container on a web page
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…
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.

762 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now