mysql server stored procedure console log

Solutions on MaxInterview for mysql server stored procedure console log by the best coders in the world

showing results for - "mysql server stored procedure console log"
Lois
11 Sep 2018
1DELIMITER $$
2
3DROP PROCEDURE IF EXISTS `debug_msg`$$
4DROP PROCEDURE IF EXISTS `test_procedure`$$
5
6CREATE PROCEDURE debug_msg(enabled INTEGER, msg VARCHAR(255))
7BEGIN
8  IF enabled THEN
9    select concat('** ', msg) AS '** DEBUG:';
10  END IF;
11END $$
12
13CREATE PROCEDURE test_procedure(arg1 INTEGER, arg2 INTEGER)
14BEGIN
15  SET @enabled = TRUE;
16
17  call debug_msg(@enabled, 'my first debug message');
18  call debug_msg(@enabled, (select concat_ws('','arg1:', arg1)));
19  call debug_msg(TRUE, 'This message always shows up');
20  call debug_msg(FALSE, 'This message will never show up');
21END $$
22
23DELIMITER ;