FirebirdSQL logo

SET BAIL

SET BAIL [ON | OFF]

This command determines if isql will "bail out" on any errors when the input command has been used to read a script file.Isql will not exit if it is running in interactive mode, and you cause an error.

Executing this command, without passing a parameter, results in a toggling of the current state.If bail is on, it will turn off and vice versa.

SET BLOBdisplay

SET BLOBdisplay [n | ALL | OFF]

This command determines if BLOB column data is displayed in the output when a table with BLOB columns is queried.The default for this command, if no parameters are passed, is to set BLOB data off — it will not be displayed, only the blob id will be shown.

The blob id is discussed above in the section describing the [isql-command-blobdump] and [isql-command-blobview] commands.

If ALL is passed, then all BLOB sub-types will be displayed.

If a number representing the blob subtype is passed, then only BLOBs with the specific subtype will be displayed.The default is 1 for text subtypes.

SQL> -- Don't display any blob data.
SQL> set blob off;

SQL> select proj_desc
CON> from project
CON> where proj_id = 'HWRII';

        PROJ_DESC
=================
             85:e


SQL> -- Display all blob data.
SQL> set blobdisplay all;

SQL> select proj_desc
CON> from project
CON> where proj_id = 'HWRII';

        PROJ_DESC
=================
             85:e
==============================================================================
PROJ_DESC:
Integrate the hand-writing recognition module into the
universal language translator.
==============================================================================

SQL> -- Only display type 1 blob data = text.
SQL> set blob 1;

SQL> select proj_desc
CON> from project
CON> where proj_id = 'HWRII';

        PROJ_DESC
=================
             85:e
==============================================================================
PROJ_DESC:
Integrate the hand-writing recognition module into the
universal language translator.
==============================================================================

SQL> -- Only display blob type 7 = not text!
SQL> set blob 7;

SQL> select proj_desc
CON> from project
CON> where proj_id = 'HWRII';

        PROJ_DESC
=================
             85:e
==============================================================================
PROJ_DESC:
BLOB display set to subtype 7. This BLOB: subtype = 1
==============================================================================

You will notice in the last example that a message was displayed advising that we are only displaying BLOB data for subtype 7 and the BLOB data in this table is a subtype 1, so the data is not displayed.

SET COUNT

SET COUNT [ON | OFF]

This command determines whether a line of text is displayed at the end of the output from a DML statement, telling the user how many rows were affected.

SQL> set count on;

SQL> select count(*) from employee;

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

Records affected: 1

The record count is displayed for all DML operations, not just for a SELECT.

SQL> create table fred( a integer);
SQL> commit;

SQL> insert into fred values (666);
Records affected: 1

SQL> update fred set a = 123 where a = 666;
Records affected: 1

SQL> delete from fred;
Records affected: 1

SQL> commit;

SET MAXROWS or SET ROWCOUNT

SET {MAXROWS | ROWCOUNT} [n]

Setting maxrows to zero, which is the default when isql is started, results in a select statement returning all rows which meet the criteria in the where clause.There are circumstances where you do not want lots and lots of output scrolling up the screen, so you may set maxrows to a smaller number and all subsequent select statements will only display the first n rows instead of everything.

Note

In older versions of isql, only set rowcount is available.

SQL> set count on;
SQL> set maxrows 0;

SQL> select emp_no from employee;

 EMP_NO
=======
      2
      4
...
    144
    145

Records affected: 42

SQL> set maxrows 10;
SQL> select emp_no from employee;

 EMP_NO
=======
      2
      4
...
     15
     20

Records affected: 10

There is no indication that maxrows is restricting the number of rows returned.It is the responsibility of the user to remember, or check whether maxrows is on or off.Using maxrows can lead to confusion about exactly how many rows there are in a table!