Setting the isql Client Dialect

From InterBase

Go Up to Setting SQL Dialects


To use isql to create a database in a particular dialect, first set isql to the desired dialect and then use it to create the database.You can set isql dialect in 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, you can issue this statement:
SET SQL DIALECT <n>

The following table shows the precedence for setting isql dialect:

isql Dialect Precedence
Ranking How dialect is set

Lowest

Dialect of an attached Version 6 and later database

Next lowest

Dialect specified on the command line: isql -sql_dialect n

Next highest

Dialect specified during the session: SET SQL DIALECT n;

Highest

Dialect of an attached Version 5 database (=1)

In InterBase 6 and later, 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 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 are accessing it through IBConsole, InterBase new interface.

Important:
Any InterBase 6 and later isql client that attaches to a version 5 database resets to dialect 1.

Advance To: