CHAPTER 6 Using Procedures and Batches
265
In ATOMIC compound statements, you cannot use an EXECUTE
IMMEDIATE statement that causes a COMMIT, as COMMITs are not allowed
in that context.
Transactions and savepoints in procedures
SQL statements in a procedure are part of the current transaction (see Chapter
8, “Transactions and Versioning”). You can call several procedures within one
transaction or have several transactions in one procedure.
COMMIT and ROLLBACK are not allowed within any atomic statement (see
“Atomic compound statements” on page 242).
Savepoints (see “Savepoints within transactions” on page 305) can be used
within a procedure, but a ROLLBACK TO SAVEPOINT statement can never
refer to a savepoint before the atomic operation started. Also, all savepoints
within an atomic operation are released when the atomic operation completes.
Some tips for writing procedures
This section provides some pointers for developing procedures.
Check if you need to change the command delimiter
You do not need to change the command delimiter in DBISQL or Sybase
Central when you are writing procedures. However, if you are creating and
testing procedures from some other browsing tool, you may need to change the
command delimiter from the semicolon to another character.
Each statement within the procedure ends with a semicolon. For some
browsing applications to parse the
CREATE PROCEDURE
statement itself, you
need the command delimiter to be something other than a semicolon.
If you are using an application that requires changing the command delimiter,
a good choice is to use two semicolons as the command delimiter (;;) or a
question mark (?) if the system does not permit a multicharacter delimiter.
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 ...