Example Programs

Two new CT-Library sample programs are available.

  • batch_lang.c - demonstrates how ct_send_params() can be used with a language statement. This sample uses ct_send_params() repeatedly to insert lines read from a file into a table. Since it uses the same location for the parameters for every line read, it does not need to call ct_param() or ct_setparam() in between calls to ct_send_params().

  • batch_dynamic.c - uses dynamic SQL and sends parameters to the server for which the data resides at different memory locations. Therefore, this sample also demonstrates how ct_setparam() can be used to rebind to different variables before calling ct_send_params() again.

The ctos sample program has been updated to include:

  • Turn on the SRV_S_PARAM_BATCHING server property.

  • Use ct_setparams() to bind CT-Lib to the location of the data.

  • Handle the new return values from srv_xferdata()

  • Call ct_send_params() for each set of command parameters.