I want to call a pgsql function In my select as follow :
select name from my_table where soundex(name) = 'foo'
So I include a tuple in before to do the select :
query += [('soundex(name)','=',soundex2(foo) ) ]
product_count = product_obj.search_count(cr, uid, query, context=context)
And I've got the following error :
Invalid field 'soundex(name)' in leaf "<osv.ExtendedLeaf: ('soundex(name)', '=', u'EKLP') on product_template (ctx: )>"
So, I do I call the soundex function inside of the 'Where' clause ?
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
About This Community
|Asked: 5/4/15, 9:07 AM|
|Seen: 413 times|
|Last updated: 5/4/15, 9:11 AM|