Skip to content

pQuery.registerOutputInt

Signature: pQuery.registerOutputInt(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 Integer 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_patient_id(:patientName, :result)");

// Set the values for the input parameters
pQuery.setString("patientName", "Ada Lovelace");
// Register the output parameters
pQuery.registerOutputInt('result');

// Execute the stored procedure
var queryResult = pQuery.doQuery("EMR Database");

// Get the value from the registered output parameter
var patientId = pQuery.getOutputParameter('result'); // "1"