informix
INFORMIX-ESQL/C Programmer's Manual
Programming with INFORMIX-ESQL/C

What Is INFORMIX-ESQL/C?

ESQL/C is an SQL application programming interface (API) that enables you to embed Structured Query Language (SQL) statements directly into a C program. The ESQL/C preprocessor, esql, converts each SQL statement and all Informix-specific code to C-language source code and invokes the C compiler to compile it.

ESQL/C Components

ESQL/C consists of the following software components:

ESQL/C Files for Windows

For Windows environments, the ESQL/C product contains the following additional executable files:

These ESQL/C executable files are located in the %INFORMIXDIR%\bin, %INFORMIXDIR%\lib, and %INFORMIXDIR%\demo directories. The %INFORMIXDIR% variable represents the value of the INFORMIXDIR environment variable.

ESQL/C Library Functions

The ESQL/C library contains a set of C functions that you can use in your application. The library functions are described in Appendix B, ESQL/C Function Library. These functions fall into the following categories:

Creating an ESQL/C Program

You create an ESQL/C program with the following steps:

  1. Embed ESQL/C statements in a c-language source program to perform the following tasks:
  2. Preprocess the ESQL/C source file with the esql command to create a C-language source file and invoke the C compiler.
  3. As necessary, correct errors reported by the preprocessor and the compiler and repeat step 2.
  4. Using the esql command, link the compiled object code into one or more executable files.

An ESQL/C source file can contain the following types of statements:

For information on C preprocessor directives and C language statements, refer to a C programming text. This chapter provides an overview of embedded SQL statements (page 1-8), ESQL/C host variables (page 1-15), ESQL/C preprocessor directives (page 1-42), and ESQL/C header files (page 1-38).

Your ESQL/C source code filename can have either of the following forms:

The particular suffix that your ESQL/C source file has determines the default order in which that source file gets compiled by the esql command. The .ec suffix is the default suffix. For more information on the .ecp suffix and the non-default order of compilation, see Running the C Preprocessor Before the ESQL/C Preprocessor.


INFORMIX-ESQL/C Programmer's Manual, Version 9.21
Copyright © 1999, Informix Software, Inc. All rights reserved