Static Embedded SQL Demo Applications
The
esqldemo.cc
,esqldem64.cc
orwesqldmo.cc
(Windows only) application demonstrates using various static ESQL statements. Theesqldemo.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.
- 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.- Change your current directory to the working directory.
- 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.- Build an ESQL executable from the ESQL source file (
esqldemo.cc
,esqldem64.cc
, orwesqldmo.cc
) by preprocessing, compiling, and linking as described in this chapter.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
orwesqldmo.exe
for the command in Step 5 to work. Forwesqldmo
, you will also need to include bothwesqldmo.obj
andwcesql.res
in the link script. See the "Building Applications Containing Windows Resources" section.- Run
esqldemo
andwesqldmo
(Windows only) with commands like these. Add appropriate -SV parameters if you are running in the small clients model. Theesqldmo
command prompts for the database to connect:
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |