IN MySQl Stored Procedure how to pass Parameters with parameter name and values i.e.

DELIMITER //
  CREATE PROCEDURE GetOffice
(countryName VARCHAR(255), countryId int(11))
     BEGIN
 		SELECT city, phone 
 		FROM offices
 		WHERE country = countryName AND 
                country_id = countryId;
     END //
  DELIMITER ;


CALL GetOffice("India",1);

This works fine but i want it the way --------
CALL GetOffice(countryName= "India",countryId=1);


Is there any way to pass parameters to stored procedure along parameter names in MySql.

try this:

call GetOffice(@countryId:=1,@countryName:='India');
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.