Contents Index Building NetWare Loadable Modules Building the sample programs

ASA Programming Guide
  Embedded SQL Programming

Sample embedded SQL programs


Sample embedded SQL programs are included with the Adaptive Server Anywhere installation. They are placed in the Samples\ASA\C subdirectory of your SQL Anywhere directory.

To reduce the amount of code that is duplicated by the sample programs, the mainlines and the data printing functions have been placed into a separate file. This is mainch.c for character mode systems and mainwin.c for windowing environments.

The sample programs each supply the following three routines, which are called from the mainlines.

The function of the mainline is to:

  1. Call the WSQLEX_Init routine

  2. Loop, getting commands from the user and calling WSQL_Process_Command until the user quits

  3. Call the WSQLEX_Finish routine

Connecting to the database is accomplished with the embedded SQL CONNECT command supplying the appropriate user ID and password.

In addition to these samples, you may find other programs and source files as part of SQL Anywhere Studio which demonstrate features available for particular platforms.


Building the sample programs
Running the sample programs
Static cursor sample
Dynamic cursor sample
Service examples

Contents Index Building NetWare Loadable Modules Building the sample programs