ODBC Server Reference Manual
Using Pass-Through Mode
HP NonStop ODBC Server Reference Manual—429151-002
6-14
Using SELECT Statements
Using SELECT Statements
When you execute a SELECT statement in pass-through mode, the NonStop ODBC
Server receives NonStop SQL/MP data and translates it to ODBC/SQL Server format.
If the data you select is of the NonStop SQL/MP INTERVAL data type, you will receive
an error message, because the NonStop ODBC Server does not support the
INTERVAL data type.
Using PREPARE and EXECUTE Statements
The NonStop SQL/MP PREPARE and EXECUTE statements dynamically compile a
statement and execute it multiple times in the session. Executing a statement by using
PREPARE and EXECUTE improves performance because the statement does not
need to compile every time it is executed.
This subsection describes how using these statements through the NonStop ODBC
Server differs from using them in NonStop SQL/MP. When used through the NonStop
ODBC Server, RELEASE is the same as when used in NonStop SQL/MP. For details
on these statements, see the NonStop SQL/MP Reference Manual.
PREPARE Statement
When used through the NonStop ODBC Server, the implementation of the PREPARE
statement differs from the NonStop SQL implementation in the following ways:
•
The string portion of the PREPARE statement is not enclosed in quotes:
For examples, see Using PREPARE, EXECUTE, and RELEASE Statements on
page 6-20.
•
Only the CORE SQL statements listed in Table 3-8 or the Transact-SQL
statements listed in Table 4-14
through Table 4-16 can be prepared.
•
Named parameters are not allowed.
•
You must use the SQLCI version of the statement (as opposed to the
programmatic SQL version).
The following considerations apply to using PREPARE in both NonStop SQL/MP and
the NonStop ODBC Server:
•
Parameters are allowed anywhere a numeric or string literal is allowed. You
cannot, however, use an unnamed parameter as a table or column name.
•
The prepared statement is recompiled when you switch to another database.
•
The statement-name must be a NonStop SQL/MP identifier.
PREPARE statement-name FROM string