Prepare/Execute Handling
The Open Data Services ODBC driver supports three prepare/execute models:
-
The gateway supports creation and execution of SQL Server stored procedures. By setting the IDS_FEATURE_EXEC_THRU_PROC string to Y, the Open Data Services ODBC driver creates a stored procedure (using SQL Server syntax) when SQLPrepare (or SQLExecute, if all parameters were not set at SQLPrepare time) is called. It then executes that stored procedure as an RPC (IDS_FEATURE_RPC_SUPPORT = Y) or language event every time the application calls SQLExecute. The stored procedure is dropped when the cursor is dropped or re-used. If this process is not supported by the gateway and DBMS, or if procedure creation is inefficient, it should not be used.
-
The gateway supports NOEXEC. The Open Data Services ODBC driver sends the SQL statement with parameter markers or dummy data, depending on the IDS_FEATURE_KEEP_PARM_MARKERS string, with the SET NOEXEC ON statement as a prefix and followed by a SET NOEXEC OFF in the same batch. The gateway can prepare the statement and keep the plan available. When the application calls SQLExecute, the Open Data Services ODBC driver resends the SQL statement with the real data replacing the parameter markers or dummy data. The gateway can then extract the real data and execute the plan with it.
-
None of the above. The Open Data Services ODBC driver sends the SQL statement with the real data whenever the application calls SQLExecute. Nothing is done at SQLPrepare time.