On Tuesday, June 23, 2015 at 3:24:48 PM UTC-7, Chris Fitzpatrick wrote:
>
>
> Hi, 
>
> I have an application that uses sequel and sequel migrations. I've been 
> asked to add a bunch of stored procedures that I have in a sql file, but am 
> not sure about the best way to do this.
> I've tried passing the sql to the db using the run method, but this has 
> some odd results as the sql statements seem to get truncated. 
> I am using the mysql jdbc adapter. 
>
> thanks for any suggestions.
>

In a migration, for each SQL statement:

run "SQL" 

If you must keep it in a separate SQL file, you can try:

 File.read('file.sql').split(';').each{|sql run sql}

But that will not work if you have a semicolon that isn't used a statement 
deliminator in the file.

Thanks,
Jeremy

-- 
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