Skip to content
Advertisement

Tag: parameters

Rails Query with ILIKE

I have written a finder as follows: params[:manufacturer] comes through in a form of a string that has been .parameterized by Rails. The problem is that a string with an “‘” or an “&” in it doesn’t get matched by ILIKE correctly. So as an example, some strings that are stored in my DB and their parameterized versions: “This is

Extract Parameters from pdo query

I have this query using pdo: SELECT * FROM users WHERE name LIKE :name AND age > :age1 AND age < :age2 how can I extract the parameters from this query with a regular expression in order to …

Parameterize an SQL IN clause

How do I parameterize a query containing an IN clause with a variable number of arguments, like this one? In this query, the number of arguments could be anywhere from 1 to 5. I would prefer not to use a dedicated stored procedure for this (or XML), but if there is some elegant way specific to SQL Server 2008, I

Advertisement