'Array in mysql or something similar
I have a question. I made this procedure, and I am curious if I can make it to return more than 1 output. Let me know if you need the tables, but the code is working only for 1 output for now. I want to return every single person who have that job and that gender.
DROP PROCEDURE IF EXISTS findPerson;
DELIMITER |
CREATE PROCEDURE findPerson(IN role_name VARCHAR(45),IN gen VARCHAR(10),OUT name VARCHAR(20))
BEGIN
SELECT Employees.Employee_Name into name
FROM Employees
JOIN Roles
ON Employees.Role_code=Roles.Role_code
WHERE Employees.Gender_MFU=gen AND Roles.Role_Name=role_name;
END |
DELIMITER ;
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|