Setting isql Client Dialect

From InterBase
Jump to: navigation, search

Go Up to Command-line isql Tool


To use isql to create a database in a particular dialect, first set isql to the desired dialect and then create the database. You can set isql dialect the following ways:

  • On the command line, start isql with option -sql_dialect n, where n is 1, 2, or 3:
isql -sql_dialect n
  • Within an isql session or in a SQL script, include the following statement:
SET SQL DIALECT n;

isql dialect precedence is as follows:

  • Lowest: Dialect of an attached version 6 or later database
  • Next lowest: Dialect specified on the command line
  • Next highest: Dialect specified during the session
  • Highest: Dialect of an attached Version 5 database (=1)

In InterBase, isql has the following behavior with respect to dialects:

  • If you start isql and attach to a database without specifying a dialect, isql takes on the dialect of the database.
  • If you specify a dialect on the command line when you invoke isql, it retains that dialect after connection unless explicitly changed.
  • When you change the dialect during a session using SET SQL DIALECT n, isql continues to operate in that dialect until it is explicitly changed.
  • When you create a database using isql, the database is created with the dialect of the isql client; for example, if isql has been set to dialect 1, when you create a database, it is a dialect 1 database.
  • If you create a database without first specifying a dialect for the isql client or attaching to a database, isql creates the database in dialect 3.

The statements above are true whether you are running isql as a command-line utility or accessing it through IBConsole.

Important: Any InterBase isql client that attaches to a Version 5 database resets to dialect 1.