Page 1 of 1

MySqlScript & DELIMITER

Posted: Tue 26 Feb 2008 22:17
by jammerjam
I'm trying to pass the following text string to a MySqlScript object and execute it against a mySQL database.

Code: Select all

DROP PROCEDURE IF EXISTS `sp_test1`;

DELIMITER |

CREATE DEFINER = 'root'@'localhost' PROCEDURE `sp_test1` 
(
  IN  `in_id`   varchar(50)
)
BEGIN
  SELECT TitleA,TitleB
  FROM test_tbl
  WHERE title_id = in_id
END|

DELIMITER ;
However, I'm getting this 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 |
If I open a MySql Query Browser window and execute the statement it works fine. Is there a setting I need to adjust to make this work?

Posted: Wed 27 Feb 2008 12:04
by Alexey.mdr
Use semicolon (;) symbol inside the script text for separating individual statements.