在调用存储过程时显示执行步骤

时间:2019-02-14 16:00:47

标签: mysql sql stored-procedures

我有一个使用所有delete语句的过程。只是为了确保我想将所有执行步骤写入文件中,以备将来参考。关于已删除多少条记录。

delimiter //
CREATE  PROCEDURE `test1`(IN tab_name VARCHAR(200) )
 BEGIN
  SET @t1 =CONCAT('delete a from ',tab_name ,' a, TABLE2  b where  
a.email=b.email' );
  PREPARE stmt3 FROM @t1;
  EXECUTE stmt3;
  DEALLOCATE PREPARE stmt3;
 END //

delimiter ;

call test1('table1');



I Expect the output to be 10 records deleted, but the actual output is 
 Query OK, 0 rows affected (8.30 sec)

0 个答案:

没有答案