Using Embedded SQL/C sample programs

Embedded SQL includes two sample programs that demonstrate typical Embedded SQL applications and are in %SYBASE%\%SYBASE_OCS%\sample\esqlc. Included in this directory are a README file and a makefile. This section gives a brief description of the sample programs.

The sample programs demonstrate specific Embedded SQL/C functionality. These programs are designed as guides for application programmers, not as Embedded SQL/C training aids. Read the descriptions at the top of each source file, and examine the source code before attempting to use the sample programs.

NoteThese simplified programs are not intended for use in a production environment. Programs written for a production environment need additional error handling.

To run the Embedded SQL/C sample programs, make sure these environment variables are set:

Make sure there is an entry in the sql.ini file for the server name used. You can use dsedit to look at the sql.ini file. If you added servers to the sql.ini file, as described in the Open Client and Open Server Configuration Guide for Microsoft Windows. You can use ocscfg to test for connections to these servers.

To run the sample programs, you must access an Adaptive Server that includes the pubs2 database. See the Adaptive Server Enterprise Installation Guide for information on installing the pubs2 database.

Before you precompile the sample programs, edit the example header file, described below, and replace the user name and password with values that are valid for your Adaptive Server. Comments in the programs show where to make the changes.