Embedded SQL Issues

Known programming issues and workaround, if any, specific to Embedded SQL.

For a list of platforms on which Embedded SQL/C and Embedded SQL/COBOL are available, see the New Features Bulletin SAP Open Server and SDK for SAP ASE 16.0 for Windows, Linux, and UNIX.

Embedded SQL Issues
CR# Description

Sharing Embedded SQL/C objects among multiple threads

Workaround: By default, Embedded SQL/C connections, cursors, and dynamic statements cannot be shared by multiple threads. The namespace for each of these object types is limited to the currently executing thread; one thread cannot refer to objects that were created by another thread. Objects can be shared by setting the macro CONNECTIONS_ARE_SHARED_ACROSS_THREADS to 1 by using the -D compiler option when compiling the sybesql.c module.

Warning!   If Embedded SQL/C objects are shared by multiple threads, the application programmer must add thread serialization code to ensure that objects associated with a single connection are not used simultaneously by multiple threads.

Normally, dynamic descriptors can be shared by multiple threads. To give each thread its own namespace for dynamic descriptors, when compiling the sybesql.c module, use the -D compiler option to set the macro DESCRIPTOR_SCOPE_IS_THREAD to 1.

Precompiler -p option

Workaround: Applications that rely on inserting empty strings instead of NULL strings when the host string variable is empty does not work if the -p option is turned on. The persistent bind implementation prevents Embedded SQL from circumventing Client-Library protocol (which inserts NULL strings).

Error or warning prevents with select into statements

Workaround: You can retrieve multiple rows with a single select into statement by using arrays as output host variables. If no errors or warnings occur, all selected rows are returned up to the limit of the length of the arrays. However, if a truncation, conversion warning, or error occurs, rows are returned only up to and including the row where the error or warning occurred. To ensure receiving all rows, use a cursor and continue fetching until there are no more rows.

Embedded SQL/C sample programs

Workaround: When you enter an incorrect password, sample programs example1.pc and example2.pc generate incorrect error numbers. You can ignore these numbers.

Embedded SQL/COBOL sample programs

Workaround:

The shared library path for compiling the sample programs must include $COBDIR/lib and $SYBASE/$SYBASE_OCS/lib. The path must also include $COBDIR/bin and $SYBASE/bin.