Re: Prepared cursor with matches
Posted in 1997
Topics: General Discussion
In article <5bj7tm$5j@cssun.mathcs.emory.edu>, wyang@aerotek.com says... > >} } 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. /Johan -- ________________________________________________________________________ | >>> The opinions herein are mine and not neccessarily my employers <<< | | Johan Andersson, Msc CSE jna@carmenta.se | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~