Questions? Feedback?powered byOlark live chat software
Bug 2183

find returns -5 when using LIKE with an OR 15 May, 2019

mike S
20 January, 2019
Product: PowerBuilder Category: DataWindow
Version: 2017 R3 Publishing: Public
Status: Scheduling Priority: P3
Classification: Sybase (legacy) bug Resolution:
Ken Guo 15 May, 2019
Hi Mike,

Thank you for telling me the information!

Regards,
Ken
mike S 15 May, 2019
same bug with occurs with FILTER
Ken Guo 23 January, 2019
Hi Mike,

Thanks for your suggestion. I will transfer this to the doc team.

Regards,
Ken
mike S 21 January, 2019
you need to at least address this the documentation!
Ken Guo 20 January, 2019
Hi Mike,

This is as you said a legacy issue. Currently we don’t have a plan to fix it. Please use one of the following methods to work around the issue:

Method 1: Add parentheses around the like clause.
ls_find = "(object_name LIKE '%" + ls_dataobject + "') OR object_name = '" + ls_dataobject + "'"

Method 2: Put the like clause at the end of the statement:
ls_find = "object_name = '" + ls_dataobject + "' Or object_name LIKE '%" + ls_dataobject + "'"


Regards,
Ken
mike S 20 January, 2019
*Phenomenon:
using like in a find only works by itself (either that or is specific to OR or whatever)
it returns -5 if you use it with anything else


*Reproduce Steps:
ls_find = "object_name LIKE '%" + ls_dataobject + "' OR object_name = '" + ls_dataobject + "'"
ll_row = ids_dw_where.Find (ls_find, 1, ids_dw_where.rowcount() )
//ll_row= -5!!!!   sybase/sap knew about this for years and never bothered to fix!!!!

ls_find = "object_name LIKE '%" + ls_dataobject + "'"
ll_row = ids_dw_where.Find (ls_find, 1, ids_dw_where.rowcount() )
//ll_row= the row or maybe 0 if not found but not -5  -- in other words it works if it is JUST the like.



Remarks:

99.9% sure that this is a legacy bug that existed in 12.5x and prior
OS:
All 
Platform:
 
Database Type:
 
Database Version: