MySQL Forums :: Stored Procedures :: Error when passing multiple values


Advanced Search

Error when passing multiple values
Posted by: Jassm Rahma ()
Date: August 12, 2016 04:52PM

Hi,

I have below stored procedure..

it only works when I pass single value like "US" but not when passing multiple values like "AE", "BH", "US", "FR"

when passing multiple values I get this error:

Procedure execution failed
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '")' at line 1


here is the stored procedure:

CREATE DEFINER=`root`@`127.0.0.1` PROCEDURE `sp_populate_memo_country_companies`(IN param_country varchar(255))
BEGIN
SELECT locations.location_id, companies.company_name, locations.location_name, first_payroll, last_payroll
FROM locations
JOIN country ON country.country_code_alpha2 = locations.country_code
JOIN companies ON companies.company_id = locations.company_id
LEFT JOIN payroll ON payroll.location_id = locations.location_id
WHERE locations.country_code IN (param_country) AND payroll_active = TRUE
GROUP BY locations.location_id
ORDER BY companies.company_name;
END


Kindly help...

Options: ReplyQuote


Subject Views Written By Posted
Error when passing multiple values 2389 Jassm Rahma 08/12/2016 04:52PM
Re: Error when passing multiple values 294 Peter Brawley 08/12/2016 07:00PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.