Greetings.  Ruby Newbie here.

I am just trying to do something simple and have hit a wall.  I am trying 
to create a dataset with a WHERE clause.  (An in-memory SQLITE3 DB is the 
backend.)  Here are my attempts:

# Create dataset of All Records, then sort it 
dsAllRecords = DBlookup[:main] 
dsAllRecords = dsAllRecords.order(:BeginCallNumber).all 
 
# Create dataset of Quartos, then sort it 
# dsQuarto = DBlookup[:main].filter(:BeginCallNumber.like('%QUARTO')) 
# dsQuarto = dsAllRecords.where(Sequel.like(:BeginCallNumber, '%QUARTO'))  
# dsQuarto = dsAllRecords.where('BeginCallNumber LIKE "%QUARTO"').sql 
# dsQuarto = dsAllRecords.grep(:BeginCallNumber, '%QUARTO') 
dsQuarto = dsQuarto.order(:BeginCallNumber).all

These four statements each fail when I run them individually:

dsQuarto = DBlookup[:main].filter(:BeginCallNumber.like('%QUARTO')) 
dsQuarto = dsAllRecords.where(Sequel.like(:BeginCallNumber, '%QUARTO'))  
dsQuarto = dsAllRecords.where('BeginCallNumber LIKE "%QUARTO"').sql 
dsQuarto = dsAllRecords.grep(:BeginCallNumber, '%QUARTO')

I gleaned these techniques for issuing a WHERE statement from the Sequel 
docs and other tutorials.  The middle two result in a Method Undefined 
error on "where()".  The last one results in an error saying I provided to 
grep two arguments when it was expecting only one (!).

I'm kind of at a loss here.  Advice appreciated by this Ruby Newbie!

Mark

-- 
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 https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to