Create a module that contains specific functionality that you can load in a CCL project using the LOAD MODULE statement.
CREATE MODULE moduleName IN input1 [,...] OUT output1[,...] BEGIN statements; END;
moduleName | The name of the module. |
input1 | The input stream or window. |
output1 | The output stream or window. |
All CCL statements are valid in a module except:
moduleName should be unique across all object names in the scope in which the statement exists. The names in the IN and OUT clauses must match the names of the streams or windows defined in the BEGIN-END block. All streams or windows with input visibility must be listed in the IN clause. All streams, windows, and delta streams (including those created by the flex operator), with output visibility must be listed in the OUT clause. The compiler generates an error if any input or output objects exist in the module and are not listed in their respective IN or OUT clause.
CREATE [DEFAULT] {MEMORY|LOG} STORE store1-inmodule;
CREATE MODULE filter_module IN moduleIn OUT moduleOut BEGIN CREATE SCHEMA filter_schema (Value INTEGER); CREATE INPUT STREAM moduleIn SCHEMA filter_schema; CREATE OUTPUT STREAM moduleOut SCHEMA filterSchema AS SELECT * FROM moduleIn WHERE moduleIn.Value > 10; END;