Compound statement)

Source: Internet
Author: User

---- 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

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.