I am trying to use pymysql to create a stored procedure in mysql database.
I have a file which contains the statements to create stored procedure.
I am running the mysql queries line by line using cursor.execure(line).
The Queries to create stored procedure runs fine on the db. But on python they are giving syntax error.
DELIMITER $$
USE `ipaybridge2`$$
DROP PROCEDURE IF EXISTS `masking`$$
CREATE DEFINER=`root`@`%` PROCEDURE `masking`()
BEGIN
query statements;
END$$
DELIMITER ;
the error i get is this: You have an error in your SQL syntax; it seems the error is around: 'DELIMITER $ $ USE `ipaybridge2` $ $ DROP PROCEDURE IF EXISTS `masking` $ $ CREAT' at line 1