MySqlScript & DELIMITER

MySqlScript & DELIMITER

Postby jammerjam » Tue 26 Feb 2008 22:17

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?
jammerjam
 
Posts: 27
Joined: Wed 09 Jan 2008 22:56

Postby Alexey.mdr » Wed 27 Feb 2008 12:04

Use semicolon (;) symbol inside the script text for separating individual statements.
Alexey.mdr
 
Posts: 729
Joined: Thu 13 Dec 2007 10:24


Return to dotConnect for MySQL