ODBC Server Reference Manual

Architecture Overview
HP NonStop ODBC Server Reference Manual429151-002
2-42
Stored Procedure Execution
The basic caching algorithm follows:
Prepared statements
Client-prepared DML statements are cached as is.
Execute-direct, with parameters
Client execute-direct statements with parameters are cached as is.
Execute-direct, without parameters
Client execute-direct statements without parameters are first parameterized, then
cached. Parameterizing involves changing some literal constants in the statement
to dynamic parameters, represented by question marks (?). The NonStop ODBC
Server parameterizes only when it seems useful and avoids doing so when no
benefits are apparent.
In the following example of parameterizing, a client-issued statement
Insert into T Values (123, "abc")
would be changed to
Insert into T Values (?,?)
In the next example, the statement
Select * from T where col1 > 20 and col2 = 30
would be changed to
Select * from T where col1 > 20 and col2 = ?
In the second example, the literal constant 30 was changed to a parameter, but the
literal constant 20 was not changed. If the 20 were changed to ?, NonStop SQL/MP
might choose a different access plan.
Stored Procedure Execution
The NonStop ODBC Server supports Stored Procedure Execution (SPE) using
ServerClass_Send to a Pathway server program. When the client issues an SPE SQL
call, the NonStop ODBC server processes the call by referring to a NonStop ODBC
Server catalog table and mapping the stored procedure name to a Pathway system
and server class name. Stored procedure execution is described in detail in Section 5,
Stored Procedures.