Running the Dynamic Cursor Sample Program

Run the dynamic cursor sample program.

Prerequisites

There are no prerequisites for this task.

Task

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

  1. Start the SAP Sybase IQ sample database, iqdemo.db.
  2. Files to build the sample programs are supplied with the sample code.

    To build the 32-bit samples on Windows, use build.bat.

    To build the 64-bit samples on Windows, use build64.bat. You may need to set up the correct environment for compiling and linking. Here is an example that builds the sample programs for an x64 platform.

    set mssdk=c:\MSSDK\v7.0
    build64

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

    To build the samples on Unix, use the shell script build.sh.

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

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

    For the Windows Mobile example, deploy and run the file esql_sample.exe on your Windows Mobile device.

    For the Unix example, run the file dcur.

  4. Each sample program presents a console-type user interface and prompts you for a command. Enter the following connection string to connect to the sample database:
    DSN=Sybase IQ Demo
  5. Each sample program prompts you for a table. Choose one of the tables in the sample database. For example, you can enter Customers or Employees.
  6. Follow the on-screen instructions.

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.