This is my first time with Mysql SP. I’ve a procedure that does several DML operations like inserts and updates. But it sometimes throws a warning. I want to show that exact warning as it is(on shell/console) when the script is executed. Currently, I get something like below when an exception occurs.
Query OK, 0 rows affected, 1 warning (0.08 sec)
When I execute the same procedure using a mysql client like workbench and execute the procedure. I get a proper error message. This is what I want printed on console.
1 10:33:03 call dbscripts(@param) 0 row(s) affected, 1 warning(s): 1062 Duplicate entry '124' for key 'PRIMARY'
How can I do this?
Thanks
You can use
SHOW WARNINGS. From the documentation: