Example programs

For the path and name of the directory containing the example files, consult the latest release notes. The examples directory also contains a makefile to build the examples.

The following is a list of the example programs with a brief description of each:
  • cnvex.cpp uses the ITConversions interface to convert an integer to other types.
  • contain.cpp shows how containers are used with the ITContainer interface ( only).
  • csql.cpp is a simple query example.
  • csql2.cpp is a simple query example that uses error callbacks.
  • csql3.cpp is a simple query example monitoring the transaction state of the connection.
  • curstst.cpp opens a cursor and scrolls through the result set in various ways.
  • cursupd.cpp illustrates the use of a cursor with parameter markers to update the database.
  • delegate.cpp is an example of object delegation.
  • dtex.cpp is a date/time interface example.
  • fsexamp1.cpp illustrates iteration through a container.
  • ifval.cpp is an example of a value object supporting multiple interfaces.
  • loadtab.cpp loads a table from a text file by using a prepared statement with ITStatement (HCL Informix® only).
  • loex1.cpp illustrates access to a large object through the ITLargeObject interface (HCL Informix only).
  • loex2.cpp is a large object and error information example. (HCL Informix only).
  • queryex.cpp illustrates the use of transaction control within a query.
  • rawval.cpp illustrates access to the ITDatum interface of a large object.
  • rowref.cpp is an example of a value object with multiple interfaces and copy-on-update.
  • rowset.cpp retrieves rows into a set.
  • simpval.cpp is an example of a value object derived from ITDatum.
  • tabcnt.cpp is a simple example issuing a query and uses value interfaces.
  • testtype.cpp is an example of a dynamically loaded value object.