IS THIS A BUG IN SQLStrLike?
Having been inspired by the Video on using MySQL etc. I have converted one of my databases to MySQL for testing. I must say I'm impressed by its performance.
I've now turned my attention to using SQL Filters and have run into a problem which appears to be in the SQLStrLike function (19.1). I have a Webapp with a simple, single table Grid. At the top of the Grid panel I have a form with a prompt into which I can type some search characters to load an SQL filter in the On_Constrain procedure. Using SQLStrLike it doesn't work. Writing the filter manually does. This is the test code:
Code:
Object oCustomer_DD is a cCUSTOMERDataDictionary
Set pbUseDDSQLFilters to True
Procedure OnConstrain
String sUseSQLStrLike sUseManualLike sSearchStr
Integer iFile iField
Get Main_File to iFile
Field_Map iFile "NAME" to iField
WebGet psValue of oFilter to sSearchStr
Move "WINE" to sSearchStr
Get SQLStrLike iField sSearchStr to sUseSQLStrLike
Constrain CUSTOMER.STATUS eq "A"
Move ("NAME LIKE '%"+sSearchStr+"%'") to sUseManualLike
Set psSQLFilter to sUseSQLStrLike // List is Blank
Set psSQLFilter to sUseManualLike // Filter works
End_Procedure
Notice that the SQLStrLike filter has double quotes around the field name while the manual code doesn't. Those quotes around the field name prevent the filter from working.
Of course, if the Search function which is built into the Grid did a full text search in javascript on the browser (lightning fast) instead of just looking at the first word (like we did in the 1980's), I wouldn't need to bother with doing it this way.
Ian
The most important leg on a three legged stool is the one that's missing.
Murphy's Law (2)