In order to understand how much effort a given DB-Library-to-Client-Library migration will take, you need to examine the DB-Library application in terms of what tasks it performs and what routines it uses.
Some DB-Library tasks, such as sending a SQL command to a server, are straightforward in both libraries.
Other tasks, such as using Open Server registered procedures, are more complex in Client-Library.
The following table classifies typical DB-Library application tasks according to the degree of effort required to duplicate the same application functionality with Client-Library:
DB-Library task |
Partial list of related routines |
Degree of effort required for migration |
Notes |
---|---|---|---|
Sending a Transact-SQL language command to a server |
dbcmd, dbfcmd, dbsqlexec |
Less than average |
Sending language commands is straightforward in Client-Library. |
Sending an RPC command to a server. |
dbrpcinit, dbrpcparam, dbrpcsend |
Less than average |
Sending RPC commands is straightforward in Client-Library. |
Inserting and retrieving text and image data from a server |
dbreadtext, dbwritetext, dbtxtptr, dbtxtimestamp |
Less than average |
Client-Library handles text and image data more gracefully than DB-Library. |
Manipulating datetime values |
dbdatename, dbdatepart, dbdatezero |
Average |
Client-Library does not provide direct equivalents for these routines. Instead, use cs_dt_crack and cs_dt_info. |
Automatic result row formatting |
dbprhead, dbprrow, dbspr1row, dbsprhead |
Average |
Client-Library does not provide equivalent routines, which can easily be replaced by application code such as that found in the exutils.c Client-Library example program. Applications that use these routines for debugging purposes can use ct_debug instead. |
Bulk copy operations |
Bulk copy routines |
Average |
DB-Library’s bcp_ routines include built-in file I/O routines, which read and write host data files and format files, and write error files. Client-Library applications use Bulk-Library, which does not include file I/O routines. |
Use pointers to result data instead of binding the data |
dbdata, dbadata |
Average |
Currently, Client-Library applications are required to bind results to memory in the application’s data space. |
Row buffering |
DBCURROW, DBFIRSTROW, DBLASTROW, dbsetrow |
More than average |
Client-Library provides cursor and array-binding functionality as an alternative to row buffering. Using cursors to replace row buffering may require some application design work. |
Registered procedures |
dbnpcreate, dbnpdefine, dbregdrop |
More than average |
Client-Library does not provide equivalent routines. Client-Library applications must send RPC commands to invoke the Open Server system registered procedures sp_regcreate and sp_regdrop to create and drop registered procedures. |
Read and write Adaptive Server pages |
dbreadpage, dbwritepage |
Do not convert |
Client-Library does not support this functionality. |
Two-phase commit |
Two-phase commit routines |
Do not convert |
Client-Library does not provide equivalent routines. Instead, Client-Library supports transaction monitors to control transactions. The Sybase World Wide Web site (http://www.sybase.com) provides an example program that performs two-phase commit with Client-Library. The illustrated technique relies on the use of undocumented Adaptive Server system stored procedures. As with any undocumented interface, Sybase does not guarantee support or maintenance of this interface. |