Creating an isql Script

From InterBase
Jump to: navigation, search

Go Up to Using SQL Scripts


You can use any text editor to create a SQL script file, as long as the final file format is plain text (ASCII).

Every SQL script file must begin with either a CREATE DATABASE statement or a CONNECT statement (including username and password) that specifies the database on which the script file is to operate. The CONNECT or CREATE statement must contain a complete database file name and directory path.

Note: You cannot set dialect in a CREATE DATABASE statement. To create a dialect 3 database, specify isql option -r 3.

A SQL script can contain any of the following elements:

  • SQL statements, as described in the Language Reference
  • isql SET commands as described in this chapter
  • Comments.

Each SQL statement in a script must end with a terminator.

Note: The SQL statement silently fails if significant text follows the terminator character on the same line. Whitespace and comments can safely follow the terminator, but other statements cannot.

Each SQL script file should end with either EXIT to commit database changes made since the last COMMIT, or QUIT to roll back changes made by the script. If neither is specified, then database changes are committed by default.

For the full syntax of CONNECT and CREATE DATABASE, see the Language Reference.

Advance To: