Control statements
240
For complete descriptions of each, see the entries in “SQL Statements” in
Adaptive Server IQ Reference Manual.
Using compound statements
A compound statement starts with the keyword
BEGIN
and ends with the
keyword
END
. The body of a procedure is a compound statement. Compound
statements can also be used in batches. Compound statements can be nested,
and combined with other control statements to define execution flow in
procedures or in batches.
A compound statement allows a set of SQL statements to be grouped together
and treated as a unit. SQL statements within a compound statement should be
separated with semicolons.
Control statement
Syntax
Compound statements
BEGIN [ ATOMIC ]
statement-list
END
Conditional execution: IF
IF condition THEN
statement-list
ELSEIF condition THEN
statement-list
ELSE
statement-list
END IF
Conditional execution: CASE
CASE expression
WHEN value THEN
statement-list
WHEN value THEN
statement-list
ELSE
statement-list
END CASE
Repetition: WHILE, LOOP
WHILE condition LOOP
statement-list
END LOOP
Repetition: FOR cursor loop
FOR
statement-list
END FOR
Break: LEAVE
LEAVE label
CALL
CALL procname( arg, ... )
Summary of Contents for Adaptive Server IQ 12.4.2
Page 1: ...Administration and Performance Guide Adaptive Server IQ 12 4 2 ...
Page 16: ...xvi ...
Page 20: ...Related documents xx ...
Page 40: ...Compatibility with earlier versions 20 ...
Page 118: ...Troubleshooting startup shutdown and connections 98 ...
Page 248: ...Importing data by replication 228 ...
Page 306: ...Integrity rules in the system tables 286 ...
Page 334: ...Cursors in transactions 314 ...
Page 396: ...Users and permissions in the system tables 376 ...
Page 438: ...Determining your data backup and recovery strategy 418 ...
Page 484: ...Network performance 464 ...
Page 500: ...System utilities to monitor CPU use 480 ...
Page 514: ...Characteristics of Open Client and jConnect connections 494 ...
Page 536: ...Index 516 ...