Passing an INPUT parameter requires several steps to provide a value as input to an application service procedure or user-defined function.

To pass an INPUT parameter:

  1. Create and initialize a variable for the parameter of the correct .NET data type (see Create variables for parameters).
  2. Add the parameter to a ParamArray object (see Set up a parameter array).
  3. Run the procedure or user-defined function (see Run procedures and user-defined functions).

Passing an INPUT parameter using the .NET OpenAPI

The following example passes an INPUT integer parameter that does not support the Unknown value (?).

// Define and initialize the variable for the input parameter
Int32 CustomerNumber = 33;

// Create the ParamArray
ParamArray parms = new ParamArray(1);

// Add the input parameter to the ParamArray
parms.AddInteger(0, CustomerNumber, ParamArrayMode.INPUT);

// Run the procedure or user-defined function
...

The following example passes an INPUT integer parameter that supports the Unknown value (?).

// Define and initialize the variable for the input parameter
Int32 CustomerNumber = 33;

...
//Define and set the holder class for the input parameter 
//to null or an integer based on the variable value
IntHolder hCustomerNumber = new IntHolder( );
iCustomerNumber = new Integer(CustomerNumber)

if (CustomerNumber > 33)
   hCustomerNumber.Value = null;
else
   hCustomerNumber.Value = (Object) iCustomerNumber;

// Create the ParamArray
ParamArray parms = new ParamArray(1);

// Add the input parameter to the ParamArray
parms.AddInteger(0, hCustomerNumber, ParamArrayMode.INPUT);

// Run the procedure or user-defined function
...