UltraLite Embedded SQL User's Guide
Building Embedded SQL Applications
This section assumes a familiarity with the overall embedded SQL development model. For more information, see Using UltraLite Static Interfaces.
You can use a simpler single-file build procedure if the following requirements are also met:
You are not using transport-layer security.
You do not wish to use publications for synchronization.
You do not need to specify an UltraLite project name.
You have more than one embedded SQL source file.
If these requirements are not all met, you must use the general build process. For instructions, see Build procedure for UltraLite embedded SQL applications .
The following diagram depicts the single-file build procedure for UltraLite database applications. In addition to your source files, you need a reference database that contains the tables and indexes you wish to use in your application.
To build an UltraLite application (one embedded SQL file only)
Start the Adaptive Server Anywhere personal database server, specifying your reference database.
Preprocess the embedded SQL source file using the SQL preprocessor.
The SQL preprocessor is the sqlpp command-line utility. 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.
Use the sqlpp -c
command-line option to connect to the reference database. In the single-file build procedure, do not specify a project on the SQL preprocessor command line.
For a list of the parameters to sqlpp, see The SQL preprocessor.
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.
Your application contains only one embedded SQL source file, called store.sqc. You can process this file using the following command. Do not specify a project name. This command causes the SQL preprocessor to write the file store.c.
sqlpp -c "uid=dba;pwd=sql" store.sqc
In addition, the preprocessor automatically runs the UltraLite generator, which generates more C/C++ code to implement your application database. This code is automatically appended to the file store.c.