Re[2]: Prepared cursor with matches
Posted in 1997
Posting and response: }} } I'm trying to prepare a cursor using >} } }} } PREPARE thingy FROM }} } "SELECT * \\ }} } FROM table \\ }} } WHERE col1 = ? \\ }} } AND col2 MATCHES ?" > } }You need to put quotes around the second variable, like > }AND col2 MATCHES '?'" } }HTH } }I might be wrong but will that not forfeit the purpose? } }What Davin wanted in the first place was to have a placeholder after }matches not a character constant. } }As I read the Informix syntax, this is actually not possible! } }Informix only allows literal constants after 'like' and 'matches' whereas }it allows a placeholder after normal operators. } }I wish to do the same thing but have had to resort to reparsing the SQL }statement each time the user changes the 'matching criteria' :-( } }Small non-intuitive restrictions like this is really irritating. I tested the same prepared statement on the same machine and Informix version (engine and tools) and it works! Using placeholder with a matches operator is possible (assuming no bugs in tools or engine). -- Peter Neilson peter_neilson@lendlease.com.au