It is often convenient to group individual statements so that they can be treated as a single unit. The BEGIN and
END statements are used in compound statements to group the statements into a unit. You can use a compound statement only in the body of a stored procedure, a user-defined function, or in a trigger declaration.
ATOMIC specifies that the set of statements within the unit either all succeed or all fail. If one condition within the BEGIN ATOMIC . . . END unit is not met, no records are affected. If the condition should affect more than one row, all rows (or none) are affected. For any record to be affected, all the conditions within a
BEGIN
ATOMIC . . . END unit must return true.