You are here: 过滤器和Joins > 数据库连接程序

数据库连接程序

数据库连接程序:当外部表中的属性通过转换进行处理时,将它们连接到传入的特征。

The DatabaseJoiner queries an external table to retrieve attributes associated with a feature. One or more feature attributes are joined to one or more columns in a table in the database, and the values from the matching table row(s) are added as feature attributes.

The_matched_recordsattribute specifies how many records in the database the feature matched to.

输出端口

Parameters

DatabaseJoiner是一个非常强大的转换器,具有许多与性能相关的设置。

读卡器

加入

Merge Attributes

优化

Tip: Where DatabaseJoiner transformers will match only on a known subset of records within a table, it will often be more efficient to prefetch that subset of records before matching takes place.

Usage Notes

关系FeatureMerger

featuremerge连接工作区中正在读取的两个数据集。featuremerge还可以使用其Merge Type参数。featuremerge在内存中执行所有连接,因此如果在同一数据上有多个关系,那么它可以比DatabaseJoiner更快。DatabaseJoiner联接由数据库使用SQL执行。文章FME2011 Use Case: Joiner vs FeatureMerger包含这些变压器的更详细的比较。

关系内联查询器/SQLCreator/SQLExecutor

The DatabaseJoiner is very useful and efficient when there exists a one-to-one or one-to-many relationship between data flowing through FME and data held within a database. If it can be used, the DatabaseJoiner can be more efficient than using either the InlineQuerier or SQLCreator/SQLExecutor, provided that the DatabaseJoiner key fields have indexes in the source database. DatabaseJoiner allows simple join relationships based on multiple attribute keys and requires no knowledge of SQL – this is often very effective for simple lookup tables. SQLCreator/SQLExecutor allow more complex joins and these are executed by the source database.

The InlineQuerier is useful in cases where data sources have no SQL ability, or for more complex queries. The InlineQuerier allows you to ask more sophisticated questions about the data than the DatabaseJoiner.

Example

Editing Transformer Parameters

使用一组菜单选项,可以通过引用工作空间中的其他元素来指定转换器参数。更高级的功能,如高级编辑器和算术编辑器,也可以在一些变压器。要访问这些选项的菜单,请单击在适用参数旁边。有关详细信息,请参阅Transformer Parameter Menu Options.

Transformer Categories

Attributes

过滤器和Joins

Search FME Knowledge Center

Search for samples and information about this transformer on theFME Knowledge Center.