Using parameters with IN() operator
Posted on 2007-08-06
I have a MySQL 5 stored procedure that takes a TEXT parameter with a comma seperated list of IDs. In the procedure I am wanting to use this to only return the rows with matching IDs using the IN() operator, but am only getting 1 row in the results (from the first ID).
CREATE PROCEDURE `InvoiceSubscriberInfo`(IN _Selected TEXT)
SQL SECURITY DEFINER
SubscriberID IN (_Selected)
ORDER BY Company, Branch;
For example if _Selected = 1056,1045,1032 it only returns results for 1056.