InterBase Quick Start: Part II - Running an SQL Script
Go Up to InterBase Quick Start: Part II - Data Definition
Contents
Data Definition Files
A data definition file (also called SQL script) is a text file that contains SQL statements. You can execute it in the Interactive SQL window of the IBConsole. To create, open or modify data definition files, you can use a text editor such as Notepad.
It is often convenient to create a data definition file rather than typing each statement, because the text editor provides you with an editing environment and the script provides a reusable record of what was entered. In practice, most data definition is done using data definition files.
The CONNECT Statement
Every SQL script must begin with a CONNECT
statement. The CONNECT
statement specifies a complete path to the database, a user name, and a password. However, if you connect to a database beforehand, you may omit the CONNECT
statement when executing an SQL script in the Interactive SQL window.
If you do specify a connect statement, make sure to modify the values accordingly. The SQL scripts that accompany this tutorial begin with the following CONNECT
statement:
CONNECT 'C:\ProgramData\Embarcadero\InterBase\gds_db\examples\database\TUTORIAL.IB'
USER 'TUTOR' PASSWORD 'tutor4ib'
Before executing a script with the above CONNECT
statement, do one of the following:
- Comment-out the statement (see Comment for more information).
- Modify the path.
Run the DOMAINS.SQL Script
- Download the InterBase Quick Start Scripts, ZIP file to your computer. The
scripts
folder contains a set SQL script files and a Readme file that explains how to use the scripts on a UNIX system. - Load the
DOMAINS.SQL
script. - Execute the query.
- To confirm that the domains now exist, click on the Domains item in the left pane of IBConsole. You should see a list of domains on the right pane.