Copyright (c) 2001 by Peter Gulutzan
All Rights Reserved.

Script Files -- An Optional Exercise

A script file is a file containing SQL statements. Generally a script file ends with the extension ".sql". Some script files are supplied with the package, for some of the exercises in this tutorial, but I don't think you'll need them. Nevertheless, I've included this section because you might want to save your own sessions, and rerun them.

The script file you will use for the exercise is called exercise.sql. It should exist already in the default directory (c:\ocelot) and should contain two lines:

-- (exercise.sql) example of a script file

If you have an old version and this file is absent, please make it yourself right now with any text editor, and type in the two lines. (NB: both lines must end with carriage return + line feed.) If you use WordPad, save exercise.sql as a "Text Document". Now, back to demo32.exe.

On the menu, choose Options | Direct SQL.

On the menu, choose File | Read.

On the dialog box that appears as a result of File | Read, enter:
and click OK.

DEMO32.EXE will read the first line (a comment) and put it just above the Command Box. Then it will read the second line (an SQL statement) and put it in the command box. Ready for execution. Since exercise.sql contains only one statement, that ends this first exercise. You may leave the statement in place since you'll need it in the next section.

Below is a screenshot from a program I wrote in Pascal (Borland/Inprise). To return to the main tutorial, click your browser's "BACK" key or click here: .