PARAMETERS Clause

Used in the LOAD MODULE statement to provide the bindings for the parameter inside the module at load time.

Syntax

PARAMETERS
		parameter1-inModule = value-parentScope [,...]

Components

parameter1-inModule

The name of the parameter defined in the module.

value-parentScope

The value in the parent scope being bound to. This value can be an expression or another parameter defined in the parent scope.

Usage

Binding a parameter refers to the process of providing a value for a parameter within the module at load time. This means that you can provide a value for the parameter that is specific to each instance of the module. In the LOAD MODULE statement, you can bind a parameter inside the module to:
  • Another parameter declared within the parent scope, or,
  • An expression when loading the module.
    Note: Expressions involving parameters or variables are evaluated at compile time using the parameter's default value and the variable's initial value. A parameter or variable in a binding expression without a default value generates an error.

You cannot directly bind a parameter defined within a module at runtime; doing so generates a server warning. You can bind module parameters using only the LOAD MODULE statement.

Example

This example maps the parameters in the module to another value (minValue=2) and to another parameter (maxValue=serverMaxValue).

CREATE MODULE filterModule
IN filterIn
OUT filterOut
BEGIN
	CREATE SCHEMA filterSchema (Value Integer);
	DECLARE
		PARAMETER Integer minValue := 4;
		PARAMETER Integer maxValue;
	END;
	CREATE INPUT STREAM filterIn SCHEMA filterSchema;
	CREATE OUTPUT STREAM filterOut SCHEMA filterSchema AS SELECT * FROM filterIn WHERE filterIn.Value > minValue and filterIn.Value < maxValue;
END;

DECLARE
	PARAMETER Integer serverMaxValue;
END;

LOAD MODULE filterModule AS filter1
IN filterIn=marketIn
OUT filterOut=marketOut
PARAMETERS minValue=2, maxValue=serverMaxValue;