Prepared Statement
CData Virtuality supports java.sql.PreparedStatement
. Prepared statements can be very important in speeding up common statement execution, since they allow the server to skip parsing, resolving, and planning of the statement.
Known Limitations
Bind variable types in function signatures, e.g. WHERE t.name = UCASE(?)
can be determined if the function has only one signature or if the function is used in a predicate where the return type can be determined. In more complex situations, it may be necessary to add a type hint with a cast or convert, e.g. UCASE(CONVERT(?, STRING))
Examples
UCASE
function has two signatures, one for theSTRING
data type IN
parameter and another one for the CLOB
data type IN
parameter.
In the following cases, it can be determined:
SELECT * FROM t WHERE t.name = UCASE(?)
SELECT * FROM t WHERE UCASE(t.name) = 'AAA'
SELECT * FROM t WHERE UCASE(t.name) LIKE '%QWE%'
In this case, it cannot be determined, and CAST
or CONVERT
must be used:
SELECT UCASE(CONVERT(?, STRING))