pQuery.clearParameters¶
Signature: pQuery.clearParameters()
Returns: ParameterizedQuery pQuery - this ParameterizedQuery object. To see what methods can be used on a ParameterizedQuery, refer to the 'Parameterized Query' functions.
Clears the current parameter values immediately.
Note
In general, parameter values remain in force for repeated use of a statement. Setting a parameter value automatically clears its previous value. However, in some cases it is useful to immediately release the resources used by the current parameter values; this can be done by calling the method clearParameters.
Parameters¶
None
Example¶
// Create the pQuery object with query to be executed
var pQuery = qie.getParameterizedQuery("update patient set name = :name, is_active = :isActive, photo = :picture where patient_id = 1");
var imageBytes = qie.base64DecodeToBytes("aGVsbG8="); // constant -- decode once, outside the loop
for (var i = 0; i < 10; i++) {
// Set the values for the input parameters
pQuery.setString("name", "/tmp/" + i + "_name.txt");
pQuery.setByte("isActive", 1);
pQuery.setBytes('picture', imageBytes);
// Execute the query
pQuery.doQuery("EMR Database");
// release parameters
pQuery.clearParameters();
}