Linking thread-safe HCL OneDB general libraries to an ESQL/C module in a Windows environment

About this task

To create a thread-safe application, you must perform the following steps:

Procedure

  1. In your source file, include the appropriate thread functions and variables of the Windows™ API.
    For more information about threads, consult your Microsoft™ or Borland programmer documentation.
  2. When you compile the source file, specify the -thread command-line option of the esql command.

    The -thread option tells the preprocessor to generate thread-safe C code when it translates SQL and statements. This thread-safe code includes calls to thread-safe functions in the HCL OneDB™ DLLs.

What to do next

If you are not creating the application with threads, omit the -thread option. Although the HCL OneDB DLLs are thread safe, your non-thread-safe application does not use the thread-safe feature when you omit -thread.