MySQL - Comment lancer une exception dans une procédure stockée?

Comment générer une exception dans la procédure stockée dans MySQL? Par exemple:

CREATE PROCEDURE SALES()
BEGIN

STATEMENT...
STATEMENT...
STATEMENT...

IF (PRICE >= 500) THEN
/** THROWS AN EXCEPTION....  
    WHAT DO TO STOP THE PROCEDURE. **/
END IF;

STATEMENT...
STATEMENT...
STATEMENT...

END;

En MySQL je pense qu'il n'y a aucun moyen de lever une exception dans une procédure stockée, mais je peux forcer une erreur en sélectionnant à partir d'un non-table existante. Par exemple:

IF (PRICE > 500) THEN
    /*throw the error here*/
    SELECT * FROM price_greater_than_500_in_throw_exception;
END IF;

Est-il un moyen plus élégant?

Grâce.

source d'informationauteur Vegetus | 2012-02-03