Syntax FACTORY_DEF InlineQueryFactory [FACTORY_NAME ] [TABLE_DEF ]+ [EXCLUDE_FEATURE_CONTENT Yes|No] [USE_FMEOBJECTS Yes|No] [INPUT
FEATURE_TYPE [ ]* []*]* [QUERY_DEF [(R_SCRIPT) ] [(SQL|SQL_ENCODED) ] [GEOMETRY_SELECTION (FIRST|AGGREGATE)]]+ [OUTPUT FEATURE_TYPE [ ]* []*]* Overview This factory stores incoming features into tables in a temporary database, against which it later performs SQL queries to obtain a new set of output features. Tables are declared in one or more TABLE_DEF clauses, which must precede the first INPUT clause. Each table definition consists of
and a single FMEParsableText-encoded string which defines the columns for the table. The column definition itself consists of an SDF string listing alternating pairs of column names and types. The
tags on the INPUT clauses associate input features with tables. As a feature enters into the factory, all attributes whose names match columns from the corresponding TABLE_DEF are extracted to form a new row in the table. A reference to the original feature is also kept with each row of every table, so that the feature can be later reconstructed when a query is executed. The SQL queries to be executed are listed as individual QUERY_DEF clauses. Each definition contains a by which the query can be referenced and the actual SQL text to be executed. The content of the can be plain text or can be FMEParsableText-encoded, depending on whether it is preceded by the SQL or SQL_ENCODED keyword, respectively. (If neither SQL nor SQL_ENCODED is specified, the corresponding query will be made as "SELECT * FROM ".) Each row returned from executing each defined query will generate a feature on the OUTPUT tag matching the . In the default configuration, the InlineQueryFactory provides a facility for copying the content of input features to the output from the result queries. (This mechanism can be disabled by use of the EXCLUDE_FEATURE_CONTENT clause.) Any output query including the special column name fme_feature_content (or a "*" specifier in the select list) will have a copy of the attributes and geometry from the original feature which was inserted into the corresponding source table. In the event that multiple fme_feature_content columns are present in the result, the attributes of all features will be merged in the order in which the features are selected. The first merged feature defining each attribute will take precedence. If the value for GEOMETRY_SELECTION is FIRST or unspecified, the result feature will contain the geometry from the first feature in the merged set; if the value is AGGREGATE, the result feature will be given a geometry which is an aggregate of all of the source features' geometry. The coordinate system of each output feature will be the same as the coordinate system of all source features which were merged to create that feature's geometry, if they all had the same coordinate system. Otherwise the output feature's coordinate system will be unset. The contents attached to any QUERY_DEF are FMEParsableText-decoded and concatenated into a single script which is executed just prior to the output SQL queries. Each table defined by TABLE_DEF is made into an R matrix variable of the same name, and the output from the script is expected to be placed into a matrix variable whose name matches the corresponding . (Normal practice would be to exclude the SQL/SQL_ENCODED part of an R-based QUERY_DEF, so that the default "SELECT * FROM " is instead executed.) Input Tags The InlineQueryFactory uses the table names from prior TABLE_DEF clauses to direct features to the appropriate table within its database.
Name of a database table, as obtained from an earlier TABLE_DEF. Output Tags The InlineQueryFactory associates its output tags with the names of queries defined by QUERY_DEF clauses. Applied to features resulting from executing the query defined by a QUERY_DEF for