Designing and Programming the Application

The first step in using Progress/ESQL is to design and program your ESQL application. An ESQL application consists of the database(s) you use to store data and one or more ESQL source files. An ESQL source file is a program written in C that contains ESQL statements and ESQL-LIB function calls.

Figure 1–4 shows a fragment of an ESQL source file that contains ESQL statements. The bold text shows the ESQL-LIB function calls.

 while (1) /* loop until last customer record read */
 {
     EXEC SQL fetch x into :custnum,
              :nam, :city, :state, :maxcred;
     printf("%-7d%-22s%-14s%-7s%8d\n", custnum, nam, city, state, maxcred);
     if (custnum > hicustnum - 3)
     {
         EXEC SQL delete from customer where current of x;
         printf("Record for customer %d deleted\n",custnum);
     }
 }
											.
											.
											. 

Figure 1–4: ESQL Sample Source File Fragment

Consider the following options when designing your application:

For more information on designing and coding your ESQL application, see Programming with ESQL."


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