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

C:\monitoring screen>ruby -rubygems sequel1.rb
sequel1.rb:257:in `get_soundex': undefined method `sound' for
#<Dopen:0x2bb7530>
 (NoMethodError)
        from sequel1.rb:278

C:\monitoring screen>

I did get it "working" in irb too in so far as the statement in bold above
when execute had irb return back to the prompt with it being still the same
line value.

I just didn't get the output displayed on stdout! now irb gives me....

irb(main):002:0> require 'rubygems'
=> true
irb(main):003:0> require 'sequel'
=> true
<68.0.100', :database => 'test', :user => 'dave', :password => 'test')
=> #<Sequel::MySQL::Database: "mysql:dave:test@/test">
irb(main):005:0> @db.call(sound(dave,temp))
NameError: undefined local variable or method `dave' for #<Object:0x28b91e0>
        from (irb):5
irb(main):006:0> @db.call(sound('dave','temp'))
NoMethodError: undefined method `sound' for #<Object:0x28b91e0>
        from (irb):6

the sound procedure has this as it's only statement....

.... sound(in str varchar(40), out text char(4)
begin
  select soundex(str)
end

from mysql admin gui tool I see thr stored procedure present.

any further pointers?

dave.

On 20 March 2011 16:33, dave lilley <[email protected]> wrote:

> Can you point me to where I can get more info on this subject matter and
> how to do it within sequel?
>
>
>
>
> On 20 March 2011 16:22, Jeremy Evans <[email protected]> wrote:
>
>> On Mar 19, 7:40 pm, dave <[email protected]> wrote:
>> > I am exploring the idea of using the built in MYSQL function Soundex
>> > any one got thoughts on the best way to achieve this?
>> >
>> > I want it so that regardless of the programming environment others may
>> > use the resulting text conversion is constantly entered and retrieved
>> > from the DB.
>> >
>> > upon collection I shall be extracting 10 - 20 chars of another field
>> > to help identify the right entry the user should select from the names
>> > returned (register type program).
>> >
>> > eg.
>> >
>> > user entered XXX YYYY
>> >
>> > xXX YYY   23 anyplace rd
>> > xxX yyy     55 hope rd
>> >
>> > hope you get the idea of what I'm wanting to do here...
>> >
>> > I am using Sequel or my connections so want to stay within this
>> > framework if at all possible,
>> >
>> > I'm thinking about having a stored procedure to obtain and return the
>> > soundex generated result thus i can save the generated value as a
>> > string.
>> >
>> > the field I am using is defined a char(4) as I've read that this is
>> > likely to give the best results but again am open to other folks views
>> > as long as it can be replicated in other programming languages (I know
>> > for sure PHP will be one not sure of others ergo wanting something
>> > that will be consistent for ALL languages) regardless of how they
>> > connect to the MYSQL db.
>>
>> If you want to have all connections to the database be able to use the
>> code, then a stored procedure or user defined function would work
>> best.
>>
>> 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.
>>
>>
>

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