Embedded SQL Steps

Embedded SQL for C and SQL Server

Embedded SQL for C and SQL Server

Embedded SQL Steps

Embedded SQL for C (ESQL/C) programming operates as follows:

  1. At a command prompt, the name of the ESQL/C source file and the appropriate build parameters are submitted to nsqlprep, which is the ESQL/C precompiler for Microsoft® Windows NT® 4.0, and Microsoft Windows® 95/98 and later operating systems. The precompiler parses the submitted file, finds the Embedded SQL statements included in the code, and processes the statements.

  2. The precompiler produces a C source code file with the Embedded SQL statements removed (commented out) and, if appropriate, a bind file. The Embedded SQL statements are replaced by calls to the run-time library (Sqlakw32.dll). The run-time library calls DB-Library (Ntwdblib.dll) to access servers running Microsoft SQL Server™ 2000 across a network.

    During this step, you can specify that stored procedures be created automatically and stored on a specific instance of SQL Server or saved in a bind file. Bind files are Transact-SQL scripts that have a .bnd extension.

  3. The C source code file is compiled with a supported C compiler to produce an object code file.

  4. The object code file and library routines are linked together with a supported linker to produce an executable file.

For more information about building an ESQL/C application, see Building Applications.