use of signal for insert statement in mysql stored procedure
I want to create a procedure in which all type of possible errors should be handled using SIGNAL. Below is my stored procedure.

    DROP PROCEDURE IF EXISTS `spItem`$$
    CREATE PROCEDURE `spItem`(
           IN p_itemname VARCHAR(50),
           IN p_itemvalue smallint(6),      
           )
    BEGIN
          INSERT INTO item VALUES('',p_itemname,p_itemvalue);
    END$$
How we can use SIGNALstatement for each kind of error in the above stored procedure that checks:-

    1. Syntax Error in the insert statement
    2. check duplicate item name
    3. check valid item value as it should just accept numeric value.
what changes will be required in the above stored procedure to handle above errors.
use of signal for insert statement in mysql stored procedure
===

I want to create a procedure in which all type of possible errors should be handled using SIGNAL. Below is my stored procedure.

    DROP PROCEDURE IF EXISTS `spItem`$$
    CREATE PROCEDURE `spItem`(
           IN p_itemname VARCHAR(50),
           IN p_itemvalue smallint(6),      
           )
    BEGIN
          INSERT INTO item VALUES('',p_itemname,p_itemvalue);
    END$$
How we can use SIGNALstatement for each kind of error in the above stored procedure that checks:-

    1. Syntax Error in the insert statement
    2. check duplicate item name
    3. check valid item value as it should just accept numeric value.
what changes will be required in the above stored procedure to handle above errors.