INFORMIX
Informix-ESQL/C Programmer's Manual
Appendix B: The Demonstration Database
Home Contents Index Master Index New Book

The Demonstration Database

Your Informix software includes a demonstration database called stores7 that contains information about a fictitious wholesale sporting-goods distributor. Many of the examples in this manual are based on the stores7 database.This appendix describes how to create it.

On Windows NT and Windows 95 systems, you must create the stores7 demonstration database using the dbaccessdemo7 script. For more information on using dbaccessdemo7 to create the stores7 database, refer to the DB-Access User Manual.

On UNIX systems, Informix also includes source files for the INFORMIX-ESQL/C demonstration programs that access and manipulate the data stored in stores7. Informix also includes source files for many of the examples in this manual.

Preparing to Create the Demonstration Database

To create or use the demonstration database, you or your database administrator must configure the environment, as follows:

Creating the Demonstration Database

The script that you use to install the demonstration database is called esqldemo7 and is located in the $INFORMIXDIR/bin directory on a UNIX server.

If you choose to name your database, you must use the following naming conventions:

For example, you might want to name the demonstration database mystores.

Important: If you create the demonstration database with a name other than stores7, you must modify the example programs to access the database you create.

To create and populate the stores7 demonstration database

    1. Create a new directory for the demonstration programs by entering the following command: mkdir dirname

    You can create this directory wherever you want the demonstration programs to be. The dirname can be any name that you choose. For example, you might want to name the directory demo_db.

    2. Make the new directory the current directory by entering the following command: cd dirname

    3. Create the demonstration database by entering any one of the following commands:

      If you do not specify a database name, the database name defaults to stores7.

      If you do not specify the -log option, your demonstration database will not support transaction logging.

      Make sure that the dbspace that you specify exists. If it does not exist, you can create the dbspace with the onspaces utility. The onspaces utility is described in the Administrator's Guide for your database server.

    After you enter one of the previous commands, a series of messages appears on the screen as each table in the database is created. If you use the default database name, the following messages appear:

Dropping existing stores7 database ...

Creating stores7 database ...


 The creation of the demonstration database is now complete.  The remainder of this script copies the examples into your current directory.

Press "Y" to continue, or "N" to abort.

    4. Press Y to copy the demonstration programs into the directory that you have created or press N to specify that the demonstration programs should not be copied.

    You can now use the demonstration database and demonstration programs.

If you make changes to your database that you do not want to keep, you can run the esqldemo7 script to create a fresh demonstration database. When the script asks if you would like to copy the demonstration programs to the current directory, press N if you have made changes to the demonstration programs and do not want them replaced with the original versions.




Informix-ESQL/C Programmer's Manual, version 9.1
Copyright © 1998, Informix Software, Inc. All rights reserved.