Firebird Documentation IndexGfix - Database Housekeeping → Setting The Database Dialect
Firebird Home Firebird Home Prev: Changing The Database ModeFirebird Documentation IndexUp: Gfix - Database HousekeepingNext: DB Housekeeping and Garbage Collection

Setting The Database Dialect

The dialect of the database is simply a term that defines the specific features of the SQL language that are available when accessing that database. There are three dialects at present (Firebird version 2.0), these are:

The command to change the SQL dialect for a database is:

gfix -s[ql_dialect] DIALECT database_name

The DIALECT parameter is simply 1 or 3.

The following example changes a database to use dialect 3 which will allow many newer features of SQL 92 to be used.

linux> gfix -sql_dialect 3 my_employee

linux> gstat -header my_employee | grep dialect
Database dialect    3

linux> gfix -sql_dialect 1 my_employee

linux> gstat -header my_employee | grep dialect
Database dialect    1

Because you cannot use gstat remotely, you may also use the isql command SHOW SQL DIALECT from a remote location to see which dialect your client and database are using, as follows:

remote> isql my_employee -user norman -password whatever
Database: my_employee

SQL> show sql dialect;
Client SQL dialect is set to: 3 and database SQL dialect is: 3

Although dialect 2 is possible on the client, trying to set a dialect of 2 will fail on the server as the following example shows.

linux> gfix -sql_dialect 2 my_employee
Database dialect 2 is not a valid dialect.
-Valid database dialects are 1 and 3.
-Database dialect not changed.

To set dialect 2 for your client connection, you use isql as follows:

linux> isql my_employee
Database: my_employee

SQL> set sql dialect 2;
WARNING: Client SQL dialect has been set to 2 when connecting -
to Database SQL dialect 3 database.

SQL> show sql dialect;
Client SQL dialect is set to: 2 and database SQL dialect is: 3

Note

The WARNING line above has had to be split to fit on the page of the PDF version of this manual. In reality, it is a single line of text.

Prev: Changing The Database ModeFirebird Documentation IndexUp: Gfix - Database HousekeepingNext: DB Housekeeping and Garbage Collection
Firebird Documentation IndexGfix - Database Housekeeping → Setting The Database Dialect