MashZone NextGen 10.2 | Appendix | Operators | Data source operators | RAQL and SQL statement parameters
 
RAQL and SQL statement parameters
You can insert parameter references in the RAQL and SQL statements of the BigMemory, JDBC, Terracotta DB, and RAQL Inline operators. They are represented by a colon, followed by the parameter name. If the name contains special characters, it must be enclosed in double quotes.
JDBC parameters
Parameters are handed over to the database server as typed values along with the SQL statement at execution time. Before a statement is handed over to the database server, it is rewritten to use JDBC parameter markers ('?') as follows:
*A single-value parameter is replaced by a single JDBC parameter marker.
*A reference of a non-empty list is replaced by a comma-separated list of JDBC parameter markers, one for each list element. This is useful for populating the values of an IN predicate by a list value.
Example
SELECT * FROM table WHERE column IN (:list)
with 3 elements in the list is rewritten to
SELECT * FROM table WHERE column IN (?,?,?)
*A reference of an empty list is replaced by a single parameter marker that refers to a NULL value.
The last rule provides a valid SQL statement for an empty list. Note that if the list of values is empty, both IN and NOT-IN predicates return the same result: UNKNOWN and not FALSE.
RAQL parameters
Parameters are handed over to the RAQL engine as typed values along with the RAQL statement at execution time. RAQL statements are usually passed unchanged to the RAQL engine. If they contain list parameters, they are rewritten to use single value parameters as follows:
*A reference of a non-empty list is replaced by a comma-separated list of parameter references, one for each list element. This is useful for populating the values of an IN predicate by a list value.
Example
SELECT * FROM feed1 WHERE column IN (:list)
with 3 elements in the list is rewritten to
SELECT * FROM feed1 WHERE column IN (:"list[1]","list[2]","list[3]")
In this case, "list[1]" etc. are generated names for the individual list elements.
*A reference of an empty list is not replaced, but a single NULL value is passed to the RAQL engine.
The last rule provides a valid RAQL statement for an empty list. Note that if the list of values is empty, both predicates IN and NOT-IN return the same result UNKNOWN and not FALSE.

Copyright © 2013-2018 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.
Innovation Release