pQuery.registerOutputBoolean¶
Signature: pQuery.registerOutputBoolean(parameterName)
Returns: ParameterizedQuery pQuery - this ParameterizedQuery object. To see what methods can be used on a ParameterizedQuery, refer to the 'Parameterized Query' functions.
Sets the output parameterName as a Java Boolean type.
Note
The parameterName may include the parameter prefix character (colon ':' or at sign '@') but is not required. For example: ':fieldValue' and 'fieldValue' will reference the same named parameter.
Parameters¶
| Type | Name | Description | Default |
|---|---|---|---|
| String | parameterName | the name of the parameter |
Example¶
// Create the pQuery object with the stored procedure to be called
var pQuery = qie.getParameterizedQuery("CALL demo_active(:patientId, :result)");
// Set the values for the input parameters
pQuery.setInt("patientId", 1);
// Register the output parameters
pQuery.registerOutputBoolean('result');
// Execute the stored procedure
var queryResult = pQuery.doQuery("EMR Database");
// Get the value from the registered output parameter
var isActive = pQuery.getOutputParameter('result'); // "true"
if (StringUtils.equals(isActive, 'true')) {
// Patient 1 is active.
} else {
// Patient 1 is inactive.
}