Contents Index Building Embedded SQL Applications Single-file build procedure

UltraLite Embedded SQL User's Guide
  Building Embedded SQL Applications

Build procedure for UltraLite embedded SQL applications


This section describes a general build procedure for UltraLite embedded SQL applications. You can use a simpler modification if your application uses only a single .sqc file. For more information, see Single-file build procedure.

This section assumes a familiarity with the overall embedded SQL development model. For more information, see Using UltraLite Static Interfaces.

Sample code 

You can find a makefile that uses this process in the Samples\UltraLite\ESQLSecurity directory. You require the separately-licensable transport-layer security option to build that sample.

For information on obtaining the transport-layer security option, see the card in your SQL Anywhere package or see http://www.sybase.com/detail?id=1015780.

Procedure 

The following diagram depicts the procedure for building an UltraLite embedded SQL application. In addition to your source files, you need a reference database that contains the tables and indexes you wish to use in your application.

The UltraLite development process with multiple embedded SQL files

To build an UltraLite embedded SQL application

  1. Start the Adaptive Server Anywhere personal database server, specifying your reference database.

  2. Run the SQL preprocessor on each embedded SQL source file.

    The SQL preprocessor is the sqlpp command-line utility. It carries out two functions in an UltraLite development project:

    Caution    sqlpp overwrites the output file without regard to its contents. Ensure that the output file name does not match the name of any of your source files. By default, sqlpp constructs the output file name by changing the suffix of your source file to .c. When in doubt, specify the output file name explicitly, following the name of the source file.

    Use the sqlpp -c command-line option to connect to the reference database and the -p command-line option to specify a project name. Use the same project name for each embedded SQL file in your project.

    For detailed information about the SQL preprocessor, see The SQL preprocessor.

    For information about projects, see Creating an UltraLite project.

  3. Run the UltraLite generator.

    The generator analyzes information collected while pre-processing your embedded SQL files. It prepares extra code and writes out a new C source file. This step also relies on your reference database.

    Enter the following command at a command-prompt:

    ulgen -c "connection-string" options

    where options depend on the specifics of your project.

    The UltraLite generator command line customizes its behavior. The following command-line switches are particularly important:

    For more information on UltraLite generator options, see The UltraLite generator.

  4. Compile each C or C++ source file for the target platform of your choice. Include

  5. Link all these object files, together with the UltraLite runtime library.

Example 

Contents Index Building Embedded SQL Applications Single-file build procedure