On Monday, July 29, 2013 10:25:41 AM UTC-7, Trevor Little wrote:
>
> I'm having a little trouble getting this to work and I'm hoping you all
> can help me. We're using Sequel 3.44.0 with sharding and TinyTDS to
> interact with our MS SQL Server database. I can't figure out how I'm
> supposed to call stored procs. It seems like I'm going to have to do
> something like:
>
> result = DB.execute("EXEC proc_Name", return: :each)
>
> but I can't get that to work and I'm not sure how I would specify a shard
> name.
>
> I'd really appreciate any light you could shed. This is the first thing
> I've come across that looks pretty easy in AR but has me stumped in Sequel.
>
In general you don't want to call Database#execute directly. In your case,
you are better off creating a dataset with custom SQL that calls the stored
procedure, and iterates over the returned rows.
DB['EXEC proc_Name'].server(:config).each do |row|
# ...
end
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/groups/opt_out.