ODBC Server Reference Manual

Stored Procedures
HP NonStop ODBC Server Reference Manual429151-002
5-56
Other Considerations
Use the ODBC functions SQLProcedures and SQLProcedureColumns. These
are described in the Microsoft ODBC 2.0 Programmer’s Reference and SDK
Guide.
CORE/ODBC Access
The CORE SQL user calls the ODBC functions SQLProcedures and
SQLProcedureColumns, as described in the Microsoft ODBC 2.0 Programmers
Reference and SDK Guide, to obtain catalog information.
Other Considerations
The following describes additional topics related to stored procedures.
Server I/O Protocol
There are two server I/O protocols the NonStop ODBC Server supports and
recommends:
The NonStop ODBC server issues a PATHSEND request; the Pathway server
packs all of the data to be returned, then replies. This is the protocol on which most
of the existing Pathway/SQL applications operate.
The Pathway server uses a “call-back” mechanism to handle replies greater than
the Guardian IPC size limit (32KB). A Pathway server might want to do a call-back
even though the total message size is less than 32K bytes. For example, a server
that returns multiple rows may want to start sending back rows of data as they are
fetched; this may provide better response time and throughput.
The server programmer must exercise caution when using no-wait I/O for call-back
operations. When the call-back option is used, the server program should do all the
WRITE operations before calling REPLY. Making a no-wait call to WRITE followed by a
call to REPLY does not guarantee that the write data is accepted by the NonStop
ODBC Server first unless the call to WRITE is first completed by a call to AWAITIO
before the call to REPLY is done.
In general, server programmers must not reply to the PATHSEND from the NonStop
ODBC Server until all data has been transferred to the NonStop ODBC server process.
This is necessary because Pathway assumes the server is available for use after the
server issues a call to REPLY. If the server continues to send data to the NonStop
ODBC Server by means of the call-back mechanism after a call to REPLY, future
PATHSEND operations to this server may experience unnecessary $RECEIVE
queuing. An early reply by the server violates the implied Pathway server protocol.
Transaction Management
The NonStop ODBC server automatically starts a transaction before sending a stored
procedure request, if there is no outstanding user transaction already. The transaction
identifier is propagated to the server class. Therefore, a TSQL batch can include stored
procedure execution and other TSQL statements in the same transaction.