Programming Interfaces Guide
CHAPTER 5. The Open Client Interface
Sybase Client Library applications send requests to Adaptive Server Anywhere. Each request triggers an event, and Adaptive Server Anywhere executes a routine to handle that event. The routine that handles an event is called an event handler.
Adaptive Server Anywhere support is described in terms of these events: the events to which it can respond, and the ways in which it responds to those events.
Events can be of two kinds:
Standard events Events defined internally in Open Server.
Programmer-defined events Events defined by the Open Client application. Adaptive Server Anywhere does not support any programmer-defined events.
The following list describes each Open Server standard event, and the Adaptive Server Anywhere handling of that event.
SRV_ATTENTION event This usually occurs when a client calls ct_cancel to stop results processing prematurely. Adaptive Server Anywhere checks the status of SRV_ATTENTION between fetches, and stops processing if the event has been received.
SRV_BULK event A client has inserted a binary large object or has issued a bulk copy request. Inserting binary large objects is supported, but bulk copies are not supported by Adaptive Server Anywhere.
SRV_CONNECT event A Client-Library client has called ct_connect. Connections to Adaptive Server Enterprise are made to the server, and the USE SQL statement sets the current database.
SRV_CURSOR event A client has sent a cursor request. This event is supported by Adaptive Server Anywhere.
SRV_DISCONNECT event A request to disconnect a client connection has been made. This event is supported by Adaptive Server Anywhere.
SRV_DYNAMIC event A client has sent a Dynamic SQL request. Dynamic SQL allows a client application to execute SQL statements containing variables whose values are determined at run-time. All the operation types available for the SRV_DYNAMIC event are supported except for the DESCRIBE_INPUT type.
SRV_LANGUAGE event A client has sent a language request, such as a SQL statement. The SQL statement is passed on to Adaptive Server Anywhere. The success of failure of the event depends on whether the SQL statement is supported by Adaptive Server Anywhere.
For information about Transact-SQL compatibility in Adaptive Server Anywhere, see the chapter Transact-SQL Compatibility.
SRV_MSG event A client has sent a message. The message ID and parameters are read, but no action is performed. The success return code is returned to the client application.
SRV_OPTION event A client has sent an option command. Options that are supported by Adaptive Server Anywhere are passed on to the database server.
SRV_RPC event A client has issued a remote procedure call. The procedure is specified as follows:
owner-name.database-name.procedure-name (parameter-list)
Adaptive Server Anywhere checks to see if the current database is the correct one, and if so executes the procedure. If the current database is not the correct one, a failure is returned.
SRV_START event A call to srv_run triggers a SRV_START event. This event is not generated by client applications.
SRV_STOP event A request to stop Adaptive Server Anywhere has been made. This event is not generated by client applications. The dbosstop utility is provided for shutting down the Open Server.
SRV_URGDISCONNECT event This event is only triggered by an Open Server application calling srv_event. It is not supported by Adaptive Server Anywhere.
Using the Open Client interface, you can use an Adaptive Server Anywhere database in much the same way as you would a SQL Server. There are some limitations, including the following:
Commit Service Adaptive Server Anywhere does not support the SQL Server Commit Service.
Prepare Transaction statement Adaptive Server Anywhere does not support the SQL Server Prepare Transaction statement used by DB-Library in a two-phase commit application to see if a server is prepared to commit a transaction.
Data types Not all Adaptive Server Anywhere and SQL Server data types are supported in Adaptive Server Anywhere. For a description of data type compatibility, see Data type mappings.
Capabilities A client/server connection's capabilities determine the types of client requests and server responses permitted for that connection. The following capabilities are not supported:
CS_REG_NOTIF
CS_CSR_ABS
CS_CSR_FIRST
CS_CSR_LAST
CS_CSR_PREV
CS_CSR_REL
CS_DATA_BOUNDARY
CS_DATA_SENSITIVITY
CS_PROTO_DYNPROC
CS_REQ_BCP
For more information on capabilities, see the Open Server Server-Library C Reference Manual.