Progress
Embedded SQL-92
Guide and Reference


Building an ESQL Application Program Executable

The ESQL precompiler accepts embedded SQL source files with the filename suffix .pc and generates C Language source files. A C compiler and linker then process the C source files, creating the application executable. You can perform these operations in one step; the ESQL precompiler invokes the C compiler, which in turn invokes the linker. Alternatively, you can specify command-line options to perform the operations in multiple steps.

Figure 2–1 illustrates the components and steps you use to process SQL statements embedded in C Language source, creating an executable application program.

Figure 2–1: Embedded SQL-92 and C source Executable Application Program

The ESQL precompiler option +T directs the precompiler to generate C source code from the ESQL application program source, keep the generated C Language source, and perform no further processing on the output.

The ESQLC command passes any properly formatted compiler options to the compiler. See the documentation for the C compiler in your environment for complete information on valid options. Two C compiler options you might use are listed here. These options are accepted by UNIX and Windows C Language compilers:

You can build the application program client.exe in a single invocation of the ESQL precompiler, or you can create it in multiple user-visible steps.

EXAMPLES

The following examples illustrate these operations:

In the first example, the ESQL precompiler processes the embedded SQL source file client.pc, generates the C source file client.c, compiles the C source into an object file, and links the object file into an executable program named newname.exe. The +K option directs the precompiler to keep all intermediate files:

> esqlc -o newname +K client.pc 

The second example completes the same operations as the first example, but in two user-visible steps:

> esqlc +T client.pc 
> esqlc +K client.c -o newname 


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