I'd like to run an arbitray bit of SQL as part of a rake task to setup a 
test DB, but, Sequel doesn't seem to like the MySQL keyword DELIMITER.

If I have this in a SQL file:

DELIMITER $$
CREATE TRIGGER `test_ins` AFTER INSERT ON `table` 
FOR EACH ROW
BEGIN
IF(NEW.`rating` = 1) THEN
INSERT INTO `new_table` (`a`, `b`, `c`) VALUES (NEW.`a`, NEW.`b`, NEW.`c`);
END IF;
END $$

When I use Sequel::Model.db.run(ddl) ; where ddl is the above, it errors 
with:

Sequel::DatabaseError: Mysql2::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 $$

Is there anyway to make this work at all?

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to