On Mar 5, 7:27 pm, "mr.freeze" <[email protected]> wrote:
> Try changing the query in get_items to:
> rows = db(db[t][f].upper().like(q.upper()+"%")).select(db[t]
> [f],distinct=True)

and be sure to look at the corresponding _select()  (that is, SQL
generated) - this may (or may not) be what you want;
It is important to note that "LIKE" is case sensitive in Postgresql.

>
> On Mar 5, 6:08 pm, weheh <[email protected]> wrote:
>
> > Mr. Freeze's code says ...
>
> >     q = request.vars.q
> >     f = request.vars.field
> >     t = request.vars.table
> >     rows = db(db[t][f].like(q+"%")).select(db[t]
> > [f],distinct=True,orderby=db[t][f])
>
> > The problem is this works with sqlite but not with postgresql. Yarko,
> > I'd read the postgreql doc before and not sure it sheds any additional
> > light on the matter, or does it? Maybe I'm not understanding it. But
> > it seems "like" is supported. So the question is why isn't it working
> > with web2py? I don't see anything wrong with Freeze's code.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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/web2py?hl=en.

Reply via email to