Using DBISQL to work with database objects

Interactive SQL (DBISQL) is a utility for entering SQL statements. If you are using DBISQL to work with your database schema, instead of executing the SQL statements one at a time, build up the set of commands in a DBISQL command file. Then you can execute this file in DBISQL to build the database.

The definitions of the database objects form the database schema. You can think of the schema as an empty database.The SQL statements for creating and modifying schemas are called the Data Definition Language (DDL).

NoteOnly one user at a time can perform DDL statements on a table. IQ locks a table during DDL operations on it. Users may, however, perform DDL on other objects in the same database at the same time. For more information, see “How locking works”.

If you use a tool other than DBISQL, all the information in this chapter concerning SQL statements still applies.

DBISQL command file

A DBISQL command file is a text file with semicolons placed at the end of commands as shown below.

CREATE TABLE t1 ( .. );
CREATE TABLE t2 ( .. );
CREATE LF INDEX i2 ON t2 ( .. );
..

A DBISQL command file usually carries the extension .sql. To execute a command file, either paste the contents of the file into the DBISQL command window (if the file has less than 500 lines) or enter a command that reads the file into the command window. For example, the command:

read makedb

reads the DBISQL commands in the file makedb.sql.

For more information about reading a file into the command window, see READ statement [DBISQL] in Reference: Statements and Options.