Feh.  I've split it into FOUR statements, summarized as:

  ActiveRecord::Base.connection.execute('DROP FUNCTION IF EXISTS 
`coverage`;')
  ActiveRecord::Base.connection.execute('DELIMITER $$')
  ActiveRecord::Base.connection.execute(sql_body)
  ActiveRecord::Base.connection.execute('DELIMITER ;')

... and it's still bombing out at the 'DELIMITER $$' statement:

ActiveRecord::StatementInvalid: Mysql::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: 
DELIMITER $$

I'm still not sure what's going on, since (as I mentioned) I can 
hand-type this into dbconsole without getting an error.

I appreciate Rob & Fred's help, but it's not a show-stopper since I've 
manually stored the function.  But I remain curious as to why something 
entered via execute() will fail when executing it by hand works.  But 
that's just curiosity, not a need.

Thanks.

- ff
-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to