MySQL : Stored Procedure Array Parameter In Where Clause
Define Stored Procedure :
DELIMITER $$
CREATE PROCEDURE GetVendor(IN pRegid TEXT)
BEGIN
SET @sql = CONCAT('SELECT * FROM vendorMaster WHERE regid IN (', pRegid, ')');
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
END
$$
Call Stored Procedure
SET @regid = '\'1625628909\',\'1625642907\'';
call GetVendor(@regid)
Comments
Post a Comment