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
Tag: parameters
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 …
sql query if parameter is null select all
Can the following query be modified to return all records if the ? is null? Answer You can also use functions IFNULL,COALESCE,NVL,ISNULL to check null value. It depends on your RDBMS. MySQL: or ORACLE: SQL Server / SYBASE:
How to use a value from one stored procedure in another?
I have the following statement in a stored procedure: DECLARE @Count INT EXEC @Count = GetItemCount 123 SELECT @Count Which calls another stored procedure with the following statement inside: SELECT …
Passing multiple values for a single parameter in Reporting Services
I have several Multi-Select parameters in my report. I am trying to find a way to pass in multiple values for a single parameter in the web query string? If I pass in a single value, it works fine. The report runs fine selecting multiple choices for a single param. My trouble lies in the web query string. Answer Although
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