Hassan Schroeder wrote:
> On Sat, Jul 31, 2010 at 5:34 PM, Dave Lilley <dglnz2 / gmail.com> wrote:
> 
>> class Dopen
>> ?def initialise
> 
> It's "initialize"
> 
>> ? ?@db = Sequel.connect(:adapter=>'mysql', :host=>'localhost',
>> :database=>'test', :user=>'dave', :password=>'test')
>> ?end
>>
>> ?def allcust
>> ? ?row = @db["SELECT * FROM cust_data"]
>> ? ?puts " in all_cust #{row}"
> 
> `puts` returns nil -- this is all you need:
> 
>   def all_customers     # more ruby-ish naming :-)
>     @db['SELECT * FROM customer_data']   # likewise
>   end
> 
> HTH,


Thank you VERY MUCH.

The initialize was the problem!!!!    -   Wood for the trees syndrome.

I had tried all manner of things - rounded brackets, single double 
quotes.
things like @db[':cust_data'].filter('acc_code' = *)
@db.with_sql['SELECT * FROM cust_data'] (again with double quotes)

Many many thanks.

Hope this helps someone else who may have a similar issue.

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