---- Start
Most programming languages use braces to define compound statements. SQL PL can also define compound statements as a whole. The format is as follows:
Syntax: <br/> label: begin [atomic | not atomic] <br/> -- variable declaration, process logic, etc. <br/> end label </P> <p> Example 1: <br/> P1: begin <br/> declare var1 int; <br/> declare var1 int; <br/> end P1 </P> <p> Example 2: <br/> begin atomic <br/> declare var1 int; <br/> declare var1 int; <br/> end
When begin is followed by the Atomic keyword, the encapsulated compound statement is treated as a processing unit. That is to say, all program commands and statements in the compound statement must be successfully run, to ensure the successful operation of the entire compound statement. If an error occurs in one of the statements, the results of the entire stored procedure will be rolled back.
---- For more information, see:SQL pl
----Statement: indicate the source for reprinting.
---- Last updated on 2010.1.28
---- Written by shangbo on 2010.1.20
---- End