Using isql to Extract Data Definitions

From InterBase
Jump to: navigation, search

Go Up to Creating Databases (Data Definition Guide)


isql enables you to extract data definition statements from a database and store them in an output file. All keywords and objects are extracted into the file in uppercase.

The output file enables users to:

  • Examine the current state of the system tables of a database. This is especially useful when the database has changed significantly since its creation.
  • Create a database with schema definitions that are identical to the extracted database.
  • Make changes to the database, or create a new database source file with a text editor.

Extracting an InterBase 4.0 Database

You can use Windows ISQL on a Windows client PC to extract data definition statements. On some servers, you can also use command-line isql on the server platform to extract data definition statements. For more information on using Windows ISQL and command-line isql, see the Operations Guide.

Extracting a 3.x Database

To extract metadata from a 3.x database, use command-line isql on the server. Use the -a switch instead of -x. The difference between the -x option and the -a option is that the -x option extracts metadata for SQL objects only, and the -a option extracts all DDL for the named database. The syntax can differ depending upon operating system requirements.

The following command extracts the metadata from the employee.ib database into the file, newdb.sql:

isql -a employee.ib -o newdb.sql

For more information on using command-line isql, see the Operations Guide.

Advance To: