CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_getdataforexport`(in tablename varchar(100),in tblcityname varchar(100))
BEGIN
set @citycode= (select citycode from ea_citymaster where cityname=tblcityname);
SET @s = CONCAT('select * from ', tablename, ' where CityCode=''',@citycode,'''');
PREPARE stmt FROM @s;
EXECUTE stmt;
END$$
0 comments:
Post a Comment