Get a handle to a SQL command that you will reuse to execute SQL statements.
Optionally turn autocommit on to ensure each command you execute is automatically committed or turn autocommit off to manually execute multiple statements under one transaction.
Each connection has one active transaction. If you need multiple concurrent transactions, you need to make multiple connections.
FairCom’s SQL engine does not support nested transactions
Direct SQL always has a transaction ready for use.
Direct SQL automatically creates a new transaction when you first create a connection and after each commit and abort. Thus, you never need to create a transaction.
Each SQL statement executes in the connection's currently open transaction. You cannot manually create a transaction.
When you want each SQL statement to commit automatically after it is run, turn on autocommit.
When you want to run multiple SQL statements in a single commit, turn off autocommit, run the statements, and commit the changes. If something goes wrong and you want to roll back the changes, abort the transaction.
Tips
Once you create a command handle, reuse it each time you run a command. This is faster and more efficient than closing it and reallocating a new command handle. Reusing a command handle has no impact on how transactions work.
When you want to repeatedly run the same SQL statement, prepare it first and then execute the prepared statement.