On Wednesday, July 20, 2016 at 9:35:44 PM UTC+2, web2py...@gmail.com wrote:
>
> Actually found out i was using the non datetime version of the date in the 
> database... Thanks all for the help.
>
> Secondary question. after i get this question i run a query with a 
> following code:
>
> query = db.table.id > 0
> if fruit:
>     query &= db.table.fruit == fruit
>
> however, the database stores this variable as capital so "APPLE" but when 
> i put in "apple" the query returns nothing.. is there a way to resolve this?
>
>
>>
secondary answer: if your database stores fruit ALWAYS in uppercase, use 
db.table.fruit == fruit.upper() .
if instead you want to receive for db.table.fruit rows containing "apple", 
"Apple", "aPPle", "applE", and so on ... follow Dave's path, but be aware 
that for tables with lots of rows it'll be putting the backend under a lot 
of pressure . 
BTW, depending on the extent of the performances you want (and the oracle 
version), you MAY want to:
- normalize that field
- use executesql setting NLS_COMP 
- use executesql with REGEXP(fruit, 'apple', 'i')
- place an index
- etc etc etc

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to