[MDEV-4191] Prepare Created: 2013-02-20  Updated: 2013-02-20  Resolved: 2013-02-20

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: 10.0.1
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Polyatykin Aleksey Assignee: Elena Stepanova
Resolution: Not a Bug Votes: 0
Labels: None


 Description   

DELIMITER $$
 
USE `dekanat`$$
 
DROP PROCEDURE IF EXISTS `Dek_ADPredmets`$$
 
CREATE  PROCEDURE `Dek_ADPredmets`(IN iGroupsID INT)
BEGIN
 
SET @qur=" SELECT * FROM tpredmets ? "; 
 
IF iGroupsID>0 THEN 
SET @a=CONCAT("WHERE groupid=", iGroupsID);
ELSE SET @a=" WHERE groupid=1074";
END IF; 
 
 
 
PREPARE Ad FROM @qur;
EXECUTE Ad USING @a;
END$$



 Comments   
Comment by Elena Stepanova [ 2013-02-20 ]

Hi Aleksey,

Could you please be a bit more verbose in regard to the nature of your complaint?

If you are getting a syntax error, it's expected, please check the manual in regard to the syntax of prepared statements: http://dev.mysql.com/doc/refman/5.6/en/prepare.html
"Parameter markers can be used only where data values should appear, not for SQL keywords, identifiers, and so forth."

If you are experiencing some other issues, please provide more details.

Comment by Elena Stepanova [ 2013-02-20 ]

I presume the quote above answered the question, so I'm closing the issue for now. If you disagree, please feel free to comment.

Generated at Thu Feb 08 06:54:30 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.