Static Embedded SQL Demo Applications

The esqldemo.cc, esqldem64.cc or wesqldmo.cc (Windows only) application demonstrates using various static ESQL statements. The esqldemo.cc application accesses the sports database, selects several rows from the customer table, and uses a cursor to manipulate a single row at a time. For most of the rows selected, the max-credit field increases by $100 and the row is updated. The last two rows are deleted.

The output of the static ESQL demo application displays information about the rows that have been updated and a message when a row has been deleted. The program also displays a message to indicate when a transaction is being rolled back. None of the updates and deletions are applied, since you might want to run this demonstration again.

The wesqldmo.cc application accesses any Progress database and illustrates how you can drive ESQL requests using Windows widgets. It reads the Progress metaschema of the chosen database to produce lists of files and lists of fields within files, as you direct.

Follow these steps to run either static ESQL demo application.

  1. Copy all the files in the ESQL directory to a working directory. The default ESQL directory is $DLC/probuild/esqlc for UNIX and %DLC%\probuild\esql for Windows.
  2. Change your current directory to the working directory.
  3. Create a copy of the Progress sports database in your working directory with the PRODB utility. For more information on the PRODB utility, see the Progress Database Administration Guide and Reference. If you plan to run the esqldemo.cc application as a small client, place a copy of the sports database procedure library (sports.pl) in the PROPATH of your Open Interface Driver.
  4. Build an ESQL executable from the ESQL source file (esqldemo.cc, esqldem64.cc, or wesqldmo.cc) by preprocessing, compiling, and linking as described in this chapter.
  5. If you preprocess in precompile mode, include -a esqldemo, -a esqldem64 or -a wesqldmo as an SQL preprocessor parameter to set the application name correctly (the call to sqllogin() in the demo application).

    When you run PROBUILD, set the name of your executable image to esqldem64 or wesqldmo.exe for the command in Step 5 to work. For wesqldmo, you will also need to include both wesqldmo.obj and wcesql.res in the link script. See the "Building Applications Containing Windows Resources" section.

  6. Run esqldemo and wesqldmo (Windows only) with commands like these. Add appropriate -SV parameters if you are running in the small clients model. The esqldmo command prompts for the database to connect:
  7. esqldemo -db sports -1 -trig sports.pl
    wesqldmo 
    


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095