Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SAP Sybase SQL Anywhere 16.0 » SQL Anywhere Server - Programming » Embedded SQL » Sample embedded SQL programs

 

Running the static cursor sample program

Run the static cursor sample program.

Prérequis

For Windows, a recent version of Microsoft Visual Studio is required.

For x86/x64 platform builds with Visual Studio, you must set up the correct environment for compiling and linking. This is typically done using Visual Studio's vcvars32.bat or vcvars64.bat (called vcvarsamd64.bat in older versions of Visual Studio).

Contexte et remarques

The executable files and corresponding source code are located in the %SQLANYSAMP16%\SQLAnywhere\C directory. For Windows Mobile, an additional example is located in the \SQLAnywhere\CE\esql_sample directory.

 Task
  1. Start the SQL Anywhere sample database, demo.db.

  2. Files to build the sample programs are supplied with the sample code.

    For Windows, run the build.bat batch file.

    If you are getting build errors, try specifying the target platform (x86 or x64) as an argument to build.bat. Here is an example.

    build x64

    For Windows Mobile, use the esql_sample.sln project file for Microsoft Visual C++. This file appears in SQLAnywhere\CE\esql_sample.

    For Unix, use the shell script build.sh to build the example.

  3. For the 32-bit Windows example, run the file curwin.exe.

    For the 64-bit Windows example, run the file curx64.exe.

    For the Unix example, run the file cur.

  4. Follow the on-screen instructions.

Résultat

The various commands manipulate a database cursor and print the query results on the screen. Enter the letter of the command that you want to perform. Some systems may require you to press Enter after the letter.