Assume I have the following stored procedure:
CREATE PROCEDURE addToList(IN string VARCHAR(128), IN tbl VARCHAR(128))
BEGIN
DECLARE query TEXT;
SET query = REPLACE( 'INSERT INTO __table__ SET string = ?', '__table__', tbl );
PREPARE stmt FROM query;
SET string = string;
EXECUTE stmt USING string;
END;Filed under MySQL, Stored procedures, Technology & no comments & no trackbacks
Trackback specific URI for this entry