Web2py sqlite select database records using wildcards
86 views
Skip to first unread message
Meinolf
unread,
Sep 12, 2016, 3:39:17 PM9/12/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to web2py-users
Anyone knows the web2py's sqlite syntax to select database records using wildcards such as %like% or contains instead of query = db.mytable.myfield == 'value'?
Dave S
unread,
Sep 12, 2016, 4:08:16 PM9/12/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to web...@googlegroups.com
On Monday, September 12, 2016 at 12:39:17 PM UTC-7, Meinolf wrote:
Anyone knows the web2py's sqlite syntax to select database records using wildcards such as %like% or contains instead of query = db.mytable.myfield == 'value'?
(I found it a good idea to pretty much read the book through ... I got the hardcopy, which is not quite up-to-date now ... and that made it easier to search through for answers to specific questions.)
I don't have examples on this computer (instead, the early code here used executesql() with "LIKE" in the WHERE clause), but I probably have an example at home.
/dps
Meinolf
unread,
Sep 12, 2016, 5:55:42 PM9/12/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to web2py-users
yes an example would do especially to use a string variable name instead of 'value', i.e db.mytable.myfield.like(variablename).select() for example. But thanks for the response, so far at least i've got an idea..