FirebirdSQL logo

SET STATs

SET STATs [ON | OFF]

This command determines whether isql displays various statistics about each SQL command executed.As usual, failing to pass a parameter results in the current setting being toggled.

This command is independent of the [isql-set-per-table-stats] command.

SQL> set stats on;

SQL> select count(*) from employee;

                COUNT
=====================
                   42

Current memory = 19570960
Delta memory = 0
Max memory = 19652528
Elapsed time = 0.001 sec
Buffers = 2048
Reads = 0
Writes = 0
Fetches = 48

SET TIME

SET TIME [ON | OFF]

This command applies to dialect 1 databases only.It causes the time portion to be displayed or not, when the selected data is a column defined with the DATE data type.It has no effect in other dialects.

SET TERM

SET TERM new_terminator current_terminator

This command changes the statement terminator as defined by the provided string.This is mostly useful when you are about to enter a string of SQL statements making up a procedure, for example, or a trigger.With the default terminator, ;, isql would attempt to execute each statement when it sees a terminating semicolon, and given PSQL internally also uses semicolons, this would result in incomplete statements being executed.You need to change the terminator first, then enter the required code.When complete, you can change it back, but when doing so, you must remember to terminate the set term command with the current terminating character(s).

When first started, isql uses the semicolon (;) as the default terminator.

You can, if desired, simply change the terminator because you prefer something other than a semicolon.You don’t have to be writing PSQL code to change it.

SQL> -- Change terminator from ; to +
SQL> set term +;

SQL> select count(*) from employee+

       COUNT
============
          42

SQL> -- Change terminator from + to 'fred'
SQL> set term fred +

SQL> select count(*) from employee fred

       COUNT
============
          42

SQL> -- Change back from 'fred' to ;
SQL> set term ; fred

See the section on the terminator for full details.

SET TRANSACTION

This is not a hidden command which is not mentioned in the output from the help set command but a Firebird SQL statement.

There is a default transaction started for you when you use isql.When you commit or rollback in isql, the default transaction ends, and a new default transaction begins.These implicitly started transactions — by default — use the SET TRANSACTION defaults, which are:

  • READ WRITE — meaning that any SQL statement that is executed may make changes in the database.

  • WAIT — meaning that if a row in a table is currently locked by another session, the execution of the statement will wait until the other session either commits or rolls back.

  • SNAPSHOT — meaning that this transaction will be guaranteed a non-volatile view of the data and will be unaffected by any changes made and committed in any other transactions that take place while this one remains unfinished by a commit or rollback.

If [isql-set-keep-tran-params] is on, implicitly started transactions will use the last SET TRANSACTION statement executed.

A full explanation of transactions is beyond the scope of this manual.For more information see the Firebird Language Reference for your Firebird version, or The Firebird Book by Helen Borrie.