Try catch in MYSQL Stored procedures
-
Hi All, I am new in MYSQL Database. I am using the interface SQLYog tool. I just want simple stored procedure with INSERT query and it should be handled exception handling(Try-catch). If the records are inserted in a table then the procedure should return 1. If the records are not inserted(because Exception may occured) then the procedure should return 0. Cau anybody help me? Please.. Thanks, Periyasamy Ramachandiran.
-
Hi All, I am new in MYSQL Database. I am using the interface SQLYog tool. I just want simple stored procedure with INSERT query and it should be handled exception handling(Try-catch). If the records are inserted in a table then the procedure should return 1. If the records are not inserted(because Exception may occured) then the procedure should return 0. Cau anybody help me? Please.. Thanks, Periyasamy Ramachandiran.
See this[^] setting handlers. To see the insertion/updation/deletion failure/success status, check
row_count()
. Something like,--your insert query
IF (row_count()[^]> 0) THEN
--insertion success
ELSE
..failureNavaneeth How to use google | Ask smart questions
-
See this[^] setting handlers. To see the insertion/updation/deletion failure/success status, check
row_count()
. Something like,--your insert query
IF (row_count()[^]> 0) THEN
--insertion success
ELSE
..failureNavaneeth How to use google | Ask smart questions
Navaneeth, Thanks for your reply. Let me try this. -Periyasamy Ramachandiran.