Re: Weirdness with escaped characters in WHERE clauses....
Posted in 1994
From Mike Reetz:
*
* 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.
For some reason, you need to escape the escape character by doing:
DECLARE c_fa CURSOR FOR
SELECT * FROM tab1 WHERE ch1 MATCHES '*\\\\?*'
Robert Minter |Data Systems Support| \\\\\\_///
Programmer, Software Development | Orange, CA | ( _ _ )
internet: rob@dssmktg.com | Tel: 714.771.0454 | (| ^ |)
bangpath: uunet.uu.net!dssmktg!rob| Fax: 714.771.3028 | \\`-'/
#include <disclaimer.h> \\_/