Dave,

This is the doc that Jeremy is referring to
http://sequel.rubyforge.org/rdoc-adapters/classes/Sequel/Dataset/StoredProcedures.html

It is defined on Sequel::Dataset. Try

DB.dataset.call_sproc(:select, :sound, 'dave')

On Mar 21, 5:40 am, dave <[email protected]> wrote:
> Jeremy,
>
> I've tried and looked at the rdoc that comes with sequel 3.21.0 and it
> implies it's wanting 2 parameters only as per listing of errors and
> finally a result but with nothing being returned.
>
> irb(main):056:0> puts s
> dave
> => nil
> irb(main):057:0> puts temp
>
> => nil
> irb(main):059:0> puts @db.call_sproc('sound',"#{s}")
> NoMethodError: undefined method `merge' for "dave":String
>         from C:/Ruby187/lib/ruby/gems/1.8/gems/sequel-3.21.0/lib/
> sequel/adapters
> /mysql.rb:96:in `call_sproc'
>         from (irb):59
>         from :0
> irb(main):060:0> puts @db.call_sproc('sound',"#{s}",temp)
> ArgumentError: wrong number of arguments (3 for 2)
>         from (irb):60:in `call_sproc'
>         from (irb):60
>         from :0
> irb(main):061:0> puts @db.call_sproc('sound',"#{s}",:select)
> ArgumentError: wrong number of arguments (3 for 2)
>         from (irb):61:in `call_sproc'
>         from (irb):61
>         from :0
> irb(main):062:0>
>
> If I was to use you're sample then it'd be wrong number of arguments
> (4 for 2) so I'm out of my depth here.
> also while looking over the rdocs i see you support full text searches
> now this might be another way of getting where i want to go.
> but again I believe i'll become unstuck as the last parameter it has
> opts{} but there's no definition of what the opts are.
>
> can you or others within this group point me to some simple code for
> either that I can test with?
>
> cheers,
>
> dave.
>
> On Mar 21, 5:21 am, Jeremy Evans <[email protected]> wrote:
>
> > On Mar 20, 2:31 am, dave lilley <[email protected]> wrote:
>
> > > Well been doing some trails, reading searching and via MYSQL console i've
> > > found this works...
>
> > >  call sound(str,temp)
>
> > > So...
>
> > > I've tried in my db connection class a new method with this  *
> > > @db.call_sproc(sound(str,temp))* and get the error below...
>
> > You aren't calling that function correctly.  Check the RDoc.  It's
> > something like:
>
> >   @db.call_sproc(:select, 'sound', str, temp)
>
> > > the sound procedure has this as it's only statement....
>
> > > .... sound(in str varchar(40), out text char(4)
> > > begin
> > >   select soundex(str)
> > > end
>
> > I'm not sure Sequel supports in and out parameters on stored
> > procedures, but that select statement should return rows, so you
> > should get a result.
>
> > Jeremy
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-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/sequel-talk?hl=en.

Reply via email to