STORES Clause

Used in the LOAD MODULE statement to bind stores in the module to stores in the parent scope.

Syntax

STORES
		store1-inModule = store1-parentScope [,...]

Components

store-inModule

The name of the store defined in the module.

store1-parentScope

The name of the store in the parent scope. Bind the module store to this store.

Usage

Unbound stores generate compilation errors. When you create windows without specifying a store, and do not create a default store, a default parser-generated memory store is temporarily created for the module. When you load the module, this parser-generated store is assigned to the default memory store of the parent scope. If no default memory store exists in the parent scope, the parser-generated memory store in the module is assigned to a parser-generated memory store created in the parent scope.
Note: Modules can participate in store dependency loops. Since all dependency loops are invalid, the instance of a dependency loop within a module will render the project unable to compile.

Restrictions

Example

This example maps a store in the module to a store in its parent scope.

CREATE MODULE filterModule
IN filterIn
OUT filterOut
BEGIN
	CREATE MEMORY STORE filterStore;
	CREATE SCHEMA filterSchema (ID Integer, Value Integer);
	CREATE INPUT WINDOW filterIn SCHEMA filterSchema PRIMARY KEY ID STORE filterStore;
	CREATE OUTPUT WINDOW filterOut SCHEMA filterSchema PRIMARY KEY DEDUCED STORE filterSTore AS SELECT * FROM filterIn WHERE filterIn.Value > 10;
END;

CREATE MEMORY STORE mainStore;
CREATE SCHEMA filterSchema (ID Integer, Value Integer);

LOAD MODULE filterModule AS filter1
IN filterIn=marketIn
OUT filterOUT=marketOut
STORES filterStore=mainStore;