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:
- -c
Directs the C compiler to compile only, and not perform the link step.
- -o file_name
Directs the linker to name the output executable program with the specified name. The default executable program name is
client.exe
. You can assign a different name to the executable program by using the -o option.You can build the application program
EXAMPLESclient.exe
in a single invocation of the ESQL precompiler, or you can create it in multiple user-visible steps.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 fileclient.c
, compiles the C source into an object file, and links the object file into an executable program namednewname.exe
. The +K option directs the precompiler to keep all intermediate files:
The second example completes the same operations as the first example, but in two user-visible steps:
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |