Previous Topic: OverviewNext Topic: CALL


SQL Control Statements

All SQL control statements are programmatic only. The following table provides a brief description of the SQL control statements.

Statement

Purpose

CALL

Invokes an SQL procedure.

Note: The CALL statement is also a DML statement. The syntax and semantics of the CALL control statement are a subset of the CALL DML statement.

CASE

Determines the execution flow by the evaluation of one or more value-expressions.

Compound

Specifies a grouping of statements, with optional definitions of local variables, cursors, and handlers.

EXEC ADS

Starts a block of CA ADS code.

IF

Determines by evaluation of a search-condition, which block of statements are executed.

ITERATE

Begins a new iteration in a programmatic loop.

LEAVE

Exits a programmatic loop.

LOOP

Defines a programmatic loop.

REPEAT

Defines a programmatic loop with an end condition.

RESIGNAL

Raises an SQL exception in a handler.

RETURN

Exits an SQL routine or compound statement, optionally returning a value.

SET Assignment

Assigns a value to a routine parameter, local variable, or host variable.

Note: This statement can also be embedded in any SQL client program.

SIGNAL

Raises an SQL exception.

WHILE

Defines a programmatic, conditional loop.