UltraLite User's Guide
Developing Embedded SQL Applications
Building embedded SQL applications
If you have a single file containing embedded SQL code, you can use the SQL preprocessor to run the UltraLite generator when it completes processing of your file. The generator appends extra C/C++ code to the single generated source file.
This single-file build process cannot be used if you wish to use any of the following features:
transport-layer security.
publications for synchronization.
In these circumstances you must use the general build process. For instructions, see Build process for UltraLite embedded SQL applications .
To build an UltraLite application (one embedded SQL file only)
Start the Adaptive Server Anywhere personal database server, specifying your reference database and a cache size of at least 10 Mb.
Preprocess the embedded SQL source file using the SQL preprocessor, supplied with SQL Anywhere. Do not specify a project. The SQL preprocessor runs the UltraLite generator automatically and appends additional code to the generated C/C++ source file. This step relies on your reference database and on the database server.
For more information, see Preprocessing your embedded SQL files.
Compile the C or C++ source file for the target platform of your choice. Include
the C file generated by the SQL preprocessor,
any additional C/C++ source files that comprise your application.
Link all these object files, together with the UltraLite runtime library.
The following diagram depicts the procedure for building your own UltraLite database application. In addition to your source files, you need to create a reference database. As explained below, this database plays dual roles, acting as an instance of the schema used in your application and storing information that the UltraLite analyzer needs to implement your database.