sz has asked for the wisdom of the Perl Monks concerning the following question:
SELECT * FROM catalog WHERE item_id='ABC1' OR item_id='EFG2'The actual statment might need more item_id's. In any case, I can't use a placeholder since they must represent a single value. I can, of course, build the query as a string by tacking on the items I want from @items_to_include but that raises all the issues that drive prudent developers to use place holders in the first place. Besides, it leads to very ugly looking code.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Using OR in SELECT statments safely
by fokat (Deacon) on Sep 14, 2002 at 20:00 UTC | |
|
Re: Using OR in SELECT statments safely
by FoxtrotUniform (Prior) on Sep 14, 2002 at 20:02 UTC | |
|
Re: Using OR in SELECT statments safely
by blokhead (Monsignor) on Sep 14, 2002 at 20:02 UTC | |
|
Re: Using OR in SELECT statments safely
by sz (Friar) on Sep 14, 2002 at 21:27 UTC |