jeudi 5 mai 2016

SELECT statement inside RAISE sqlite

I'm trying to get the error description for RAISE using a select statement, but its not working. Here's my code:

CREATE TRIGGER fetch_survey_list INSERT ON surveylst_offline_info
BEGIN
    SELECT CASE
        WHEN ( (SELECT van from surveylst_offline_info WHERE van = new.van) IS NOT NULL)
        THEN 
        RAISE (FAIL, SELECT error_des FROM ErrorTable WHERE error_id = 1;)
    END;
END; 

TIA!

Aucun commentaire:

Enregistrer un commentaire