Two syntax errors:
-
You need commas in between the conditions for your exit handler. Notice the syntax documentation shows commas.
-
You need to terminate the
END
of the exit handler with a semicolon. TheDECLARE
statement itself (including its BEGIN…END block) is a statement like any other, and need to have a terminator.
So you need this:
DECLARE EXIT HANDLER FOR SQLEXCEPTION, SQLWARNING
BEGIN
ROLLBACK;
END;