CHAPTER 6 Using Procedures and Batches
243
The structure of procedures
The body of a procedure consists of a compound statement as discussed in
“Using compound statements” on page 240. A compound statement consists
of a BEGIN and an END, enclosing a set of SQL statements. The statements
must be separated by semicolons.
The SQL statements that can occur in procedures are described in “SQL
statements allowed in procedures” on page 243.
Procedures can contain control statements, which are described in “Control
statements” on page 239.
SQL statements allowed in procedures
Almost all SQL statements are allowed within procedures, including the
following:
•
SELECT, UPDATE, DELETE, INSERT and SET VARIABLE.
•
The CALL statement to execute other procedures.
•
Control statements (see “SQL statements allowed in procedures” on page
243).
•
Cursor statements (see “Using cursors in procedures” on page 251).
•
Exception handling statements (see “Using exception handlers in
procedures” on page 261).
•
The EXECUTE IMMEDIATE statement.
Some SQL statements are not allowed within procedures. These include the
following:
•
CONNECT statement
•
DISCONNECT statement.
COMMIT, ROLLBACK and SAVEPOINT statements are allowed within
procedures with certain restrictions (see “Transactions and savepoints in
procedures”).
For details, see the
Usage
for each SQL statement in the chapter “SQL
Statements” in Adaptive Server IQ Reference Manual.
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 ...