Hello Angellll, thank you for your quick reply. I tried the syntax you suggets, no luck:
DELIMITER//;
CREATE PROCEDURE sp_create_database_and_use
BEGIN
PREPARE STMP FROM 'CREATE DATABASE ' + name;
EXECUTE STMP;
DEALLOCATE PREPARE STMP;
END//
DELIMITER;//
I am getting
Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DELIMITER//' at line 1
SQLState: 42000
ErrorCode: 1064
Error occured in:
DELIMITER/
If I try
CREATE PROCEDURE sp_create_database_and_use
BEGIN
PREPARE STMP FROM 'CREATE DATABASE ' + name;
EXECUTE STMP;
DEALLOCATE PREPARE STMP;
END
I am getting the following error
Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '+ name;EXECUTE STMP;DEALLOCATE PREPARE STMP;END' at line 3
SQLState: 42000
ErrorCode: 1064
I am using mysql version 5.1.37. Any other thoughts?
Main Topics
Browse All Topics





by: angelIIIPosted on 2009-09-23 at 04:11:19ID: 25401736
please try with this kind of syntax: ad.php?60, 3127,6260# msg-6260
http://forums.mysql.com/re