Contents IndexUsing the EXECUTE IMMEDIATE statement in procedures Some hints for writing procedures

User's Guide
   Part III. Using SQL Anywhere
     Chapter 20. Using Procedures, Triggers, and Batches
      Transactions and savepoints in procedures and triggers

SQL statements in a procedure or trigger are part of the current transaction (see the chapter "Using Transactions and Locks"). 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"). Note that triggers are fired due to an INSERT, UPDATE, or DELETE which are atomic statements. COMMIT and ROLLBACK are not allowed in a trigger or in any procedures called by a trigger.

Savepoints (see "Savepoints within transactions") can be used within a procedure or trigger, 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.

Contents IndexUsing the EXECUTE IMMEDIATE statement in procedures Some hints for writing procedures