Skip to content

pQuery.getOutputParameter

Signature: pQuery.getOutputParameter(parameterName)

Returns: String value - the value of the output parameter

Gets the value returned for the output parameterName.

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"