Overview of DB2 Flow Control clauses

Source: Internet
Author: User

The DB2 flow control clause may not be familiar with many new users who are using the DB2 database. The following section describes the DB2 flow control clause for your reference.

The CASE structure selects an execution path based on the calculation of one or more conditions.

The FOR structure executes a code block FOR each row in the table.

The get diagnostics statement returns information about the previous SQL statement to an SQL variable.

The GOTO statement transfers the control to one or more statement blocks of a labeled block, identified by a unique SQL name and colon ).

Select an execution path for the IF structure based on the condition calculation. The ELSEIF and ELSE clauses allow the execution of branches, or specify the default operations that are performed when other conditions are not met.

The ITERATE clause transmits the flow control to the beginning of a labeled loop.

The LEAVE clause leaves the program control out of a loop or code block.

The LOOP clause executes a code block multiple times until the LEAVE, ITERATE, or GOTO statements exit the LOOP.

The REPEAT clause repeats a code block until the specified search condition returns true.

The RETURN clause returns control from the SQL process to the caller.

The SET clause assigns a value to an output or SQL variable.

WHILE repeats a code block when the specified condition is true.

The preceding section describes the DB2 Flow Control clauses.

Principle of DB2 cursor

Two ways to store db2 logs

Four Common DB2 cycle statements

Implementation of creating a database in DB2

DB2 database authorization

Related Article

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.