Transactions And Savepoints In Procedures; Some Tips For Writing Procedures; Check If You Need To Change The Command Delimiter - Sybase Adaptive Server IQ 12.4.2 Administration And Performance Manual

Table of Contents

Advertisement

Transactions and savepoints in procedures

Some tips for writing procedures

Check if you need to change the command delimiter

In ATOMIC compound statements, you cannot use an EXECUTE
IMMEDIATE statement that causes a COMMIT, as COMMITs are not allowed
in that context.
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.
This section provides some pointers for developing procedures.
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
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.
CHAPTER 6
Using Procedures and Batches
CREATE PROCEDURE
statement itself, you
265

Advertisement

Table of Contents
loading

Table of Contents