Query Mode Modify SQL
- How-to
- Pete Yankovich
- PowerBuilder
- Thursday, 17 June 2021 04:25 PM UTC
PB 2017R2, using Query Mode for retrieval. I need to change a where clause to use "like" instead of "=".
Code from retrieval event:
ls_sql = this.GetSQLSelect()
if pos(ls_sql, "S%") > 0 then
ls_sql = Replace(ls_sql, pos(ls_sql, "mtk_nb_document ="), 17, "mtk_nb_document like")
li_sql = this.SetSQLSelect(ls_sql)
end if
The Replace command generates the correct SQL, but SetSQLSelect generates this SQL:
and (((mtk_nb_document like '099479S%'))) and (((mtk_nb_document = '099479S%')))
Should I be changing the SQL in another event?
Any help is appreciated.
Pete
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.