gadfly and SQL-LIKE

  • Thread starter Patrick W. Fraley
  • Start date
P

Patrick W. Fraley

Hi Everybuddy,

I am having a little problem I can not find a solution for.

I am trying to use the SQL-LIKE statement in gadfly. After googling
around I found out that it is not supported, and that on is supposed to
use a regular expression. All great, but there is nowhere a reference
to be found on how to do this. No examples, no nothing, just the
comment to use regular expressions.

Could someone here point me into the right direction?

TIA
Patrick W. Fraley
 
A

Aaron Watters

Patrick W. Fraley said:
Hi Everybuddy,

I am having a little problem I can not find a solution for.

I am trying to use the SQL-LIKE statement in gadfly. After googling
around I found out that it is not supported, and that on is supposed to
use a regular expression. All great, but there is nowhere a reference
to be found on how to do this. No examples, no nothing, just the
comment to use regular expressions.

As it currently stands what you need to do is evaluate the query
using gadfly, pull the query out into "normal" python, and then use
a python loop and string operations (such as regular expressions) to
choose the results you want (and throw out the others).

This will work for analogues of simple positive queries such as

select a,b
from t
where c like '%this%'

but may not for fancy queries involving "not in" and so forth -- which
would require a proper implementation of "like" in gadfly. Sorry.

Probably the "right" way to fix this is to allow the importation of an
arbitrary function into gadfly from python, which wouldn't be too hard
but isn't trivial.
-- Aaron Watters

ps: my copy of MSAccess doesn't support "like" properly either, fwiw...

===
to do is to be -- Sartre
to be is to do -- Marx
do be do be do -- Sinatra
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top