DELIMITER $$
DROP PROCEDURE IF EXISTS `badilla`.`crea1` $$
CREATE PROCEDURE `badilla`.`crea1` (tablename varchar(64), num int, num2 int, num3 int, num4 varchar(30))
BEGIN
SET @stmtqry = CONCAT('INSERT INTO ', tablename, ' VALUES (', num, ', ', num2, ', ', num3, ', ''', num4, ''')');
PREPARE stmtsql FROM @stmtqry;
EXECUTE stmtsql;
DEALLOCATE PREPARE stmtsql;
END$$
DELIMITER ;
CALL crea1('tabla1', 1, 2, 3, '4');
Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.