FirebirdSQL logo

SET WARNINGS or SET WNG

SET {WARNINGS | WNG} [ON | OFF]

This command specifies whether warnings are to be output.A few examples for which isql issues warnings are:

  • SQL statements with no effect.

  • Pending database shutdown.

  • API calls that may be replaced in future versions of Firebird.

  • Expressions that may cause differing results in different versions of Firebird.

  • Connecting to a database with a connection dialect different from the database dialect.

  • In Firebird 1.0, SQL statements with ambiguous join specifications.More recent Firebird versions will raise an exception rather than a warning.

As with many of the set commands, set warnings acts as a toggle if no parameter is supplied.

SET WIDTH

Normally the width of a character column in a table defines the width of the output when that column is selected.Using the set width command allows the user to define a wider or narrower output column width.

The format of the command is:

SET WIDTH column_or_alias [width]

The setting remains until changed to a new width, or until cancelled by the set width column_or_alias command;no width supplied means use the default width setting for this column.

The following example shows the width of the last_name column being amended.The first SELECT shows the default setting which is a width of 20 characters (count the '=' in the headings) which is the definition of the last_name column in the employee table.The second shows the width being reduced to 10 characters.

SQL> select first 10 emp_no, last_name
CON> from employee
CON> order by last_name;

 EMP_NO LAST_NAME
======= ====================
     34 Baldwin
    105 Bender
     28 Bennet
     83 Bishop
    109 Brown

SQL> set width last_name 10;

SQL> select first 10 emp_no, last_name
CON> from employee
CON> order by last_name;

 EMP_NO LAST_NAME
======= ==========
     34 Baldwin
    105 Bender
     28 Bennet
     83 Bishop
    109 Brown

EMP_NO is a smallint data type.Unfortunately, it’s not possible to change the width on non-character columns like integer, smallint etc.The set width emp_no 10; command, for example, has no effect, as shown below, which also demonstrates turning off a previous width setting for the last_name column:

SQL> set width last_name;

SQL> set width emp_no 10;

SQL> select first 10 emp_no, last_name
CON> from employee
CON> order by last_name;

 EMP_NO LAST_NAME
======= ====================
     34 Baldwin
    105 Bender
     28 Bennet
     83 Bishop
    109 Brown

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.