Weirdness with escaped characters in WHERE clauses....
Posted in 1994
} } Has anyone seen this before: } } ISQL } } SELECT * FROM tab1 WHERE ch1 MATCHES "*\\?*" } } works fine...returning all rows where column ch1 contains } a question mark (?). } } 4GL } } DECLARE c_fa CURSOR FOR } SELECT * FROM tab1 WHERE ch1 MATCHES '*\\?*' } } } returns all the rows in table tab1. } } But, if I use } } DECLARE c_fa CURSOR FOR } SELECT * FROM tab1 WHERE ch1 MATCHES '*z?*' ESCAPE "z" } } works fine...returninf the same rows as the ISQL statement. } } What gives?!? Is this a bug? } Pg 7-264 4.00 4gl ref manual. The "\\" by itself in 4gl is not enough, you HAVE to tell it that "\\" or "z" in the second case is the escape character. The manual doesn't exactly tell you that - but I have tried it before and wound up using '*z**' ESCAPE "z". j. _____________________________________________________________________________ Jack Parker | Hewlett Packard, BSMC Boise, Idaho, USA| Oh No! I'm out of Starbucks jparker@hpbs3645.boi.hp.com | - panic - brain will not boot. (208) 396-5388 (W) (208) 384-1623 (H) | _____________________________________________________________________________ Any opinions expressed herein are my own and not those of my employers. _____________________________________________________________________________