To meet your needs, we constantly work to improve Querix products.
This means that Lycia documentation is developing as well.
In case you have found a certain dissonance between the provided information and the actual behavior of Lycia 3 and/or your applications, please, let us know about this via documentation@querix.com so that we can introduce the necessary changes to our documentation.
Thank you for your attention and cooperation.
This method is used with a variable of the PREPARED data type. The variable must first be initialized using the Prepare() method. The SetParameters() method is used if the prepared statement contains any placeholders - it supplies values to substitute these placeholders.
This method accepts a number of arguments, their number, order and data types depending on the placeholders. The values are bound by reference, so any changes in the bound values will be reflected in the prepared statement.
You can call the SetParameters() method for the PREPARED variable, if this variable is then used independently of any cursor. If you use this variable in the Declare() method to associate the prepared statement with a cursor, you need to execute the SetParameters() method for the CURSOR variable declared by this method and not for the PREPARED variable.
An example method call:
# Using it for the PREPARED variable
DEFINE prep_v PREPARED
CALL prep_v.Prepare("SELECT * FROM customers WHERE cust_id>?")
CALL prep_v.SetParameters(100)
...
# Using it for a CURSOR variable
DEFINE prep_v PREPARED,
cur_v CURSOR
CALL prep_v.Prepare("SELECT * FROM customers WHERE cust_id>?")
CALL cur_v.Declare(prep_v)
CALL cur_v.SetParameters(100)