First page Back Continue Last page Image

Why do I care about Handling Errors?

DELIMITER // 

CREATE PROCEDURE test()

BEGIN

INSERT INTO general_ledger_accounts

VALUES (130, 'Cash');

SELECT '1 row was inserted.';

END//

Here we have an example of a procedure with no Error Handling, performing a function that generates an error

Error Code: 1062. Duplicate entry 'Cash' for key 'account_description'

Do you really want your Users deciding how to solve a problem? If they were capable of doing this they would be programmers :-)

No real problem you just cannot enter Cash values into your Accounting System