Originally Posted by
Martin Moleman
Will take another look at the SQLStrLike function to see if we can improve for MySQL use.
Thanks Martin,
I had come to the conclusion that it had to be a syntax difference between MySQL and MsSQL. When I tested your code on my MySQL Workbench 1 and 2 needed the Search String enclosed in % signs.
Code:
Select * from Customer Where City like 'M%'; //Does not work
Code:
Select * from Customer Where City like '%M%'; //Does work
While you're looking at it, is there any reason why you need to pass iField to it rather than the Field name? The string it returns uses the field name so the user has to use Field_Map to call the Function which must then do the reverse.
Also, Dennis might like to look at the Help. Under SQLStrLike in the Development Guide the example shows iFile being passed, which is wrong:
Code:
Set pbUseDDSQLFilters to True
Procedure OnConstrain
String sFilter
Integer iFile
Get Main_File to iFile
Get SQLStrLike iFile “J” to sFilter
Set psSQLFilter to sFilter
End_Procedure
The definition of SQKStrLike in the Help for Datadictionary methods shows:
Code:
Function SQLStrLike Integer iField String sSearch Returns String
Which is correct.
Ian