🛠️ Scheduled Maintenance | We’ll be undergoing scheduled maintenance and upgrades between 00:00 PST Jan 26th until 00:00 PST Jan 28th. There may be brief interruption of services in that period. We apologize for the inconvenience.

×
The 365 Data Science team is proud to invite you to our own community forum. A very well built system to support your queries, questions and give the chance to show your knowledge and help others in their path of becoming Data Science specialists.
Ask
Anybody can ask a question
Answer
Anybody can answer
Vote
The best answers are voted up and moderated by our team

HOW TO INVOKE A PROCEDURE WITH MULTIPLE PARAMETERS USING CALL SYNTAX?

HOW TO INVOKE A PROCEDURE WITH MULTIPLE PARAMETERS USING CALL SYNTAX?

1
Vote
1
Answer

Hi Team,
I have a question about the stored procedure regarding the below code.
USE employees;
DROP PROCEDURE IF EXISTS emp_info;
DELIMITER $$
CREATE PROCEDURE emp_info( IN p_first_name VARCHAR(14), IN p_last_name VARCHAR(16), OUT p_emp_no INTEGER)
BEGIN
SELECT e.emp_no INTO p_emp_no
FROM employees e
WHERE e.first_name = p_first_name and e.last_name = p_last_name;
END$$
DELIMITER ;
 
My Question is how do you invoke the procedure using the CALL syntax. I know how to invoke it using the workbench schema. However, when I tried using the CALL function like this : CALL emp_info (Georgi, Facello), there’s an error code 1318 Incorrect Number of Arguments. I can see that there’re 3 arguments in the procedure, but what should I input in the third argument. Is the third argument @p_emp_no?If so, why is the third argument @p_emp_no?
 

1 Answer

365 Team
0
Votes

Hi Vinh!
Thanks for reaching out.
The 3rd parameter is an OUT parameter – it contains the value you’ll obtain after calling the procedure. Please feel free to revisit the following lecture or ask more questions for more information: https://365datascience.teachable.com/courses/360102/lectures/5529158 
Hope this helps.
Best,
Martin