Skip to main content
Forgive me if this question has been asked before. I don't know how to phrase it in such a way that I can find an easy answer though.

 

 

Bascially, I'm developing an fme script to QA incoming topographic data against our business rules and then compare it against our database to determine the change.

 

 

What I want to do, is have the database reader only pull feature classes from our database that match the incoming data: eg: only pull the roadsegment feature class from the database if a roadsegment feature class was provided.

 

 

If I haven't given enough information or this questions was answered elsewhere please point me in the right direction.

 

Appreciate any help. Thanks.
Hi,

 

 

In this case, SQLExecutor transformer might be more suitable than readers, a probable approach is: 1) Sample the first feature from the incoming dataset. 2) Determine the feature classes based on the feature, and create a preferable query (SQL statement) as new attribute of the feature, which can pull data related to the matched feature classes. 3) Using the feature as INITIATOR, execute  the query with an SQLExecutor.

 

 

Hope this helps.

 

Takashi
Hi,

 

 

Optionally, if the incomming data share a common attribute, you could use the feature reader with a where clause, to read only the features of interest.

 

Hope this helps
Two good answers already - here is a third:

 

 

Do your users need to specify which feature class they are providing?  (from your example roadsegment)

 

 

You could create a paremeter where they choose this and then link this parameter to the "feautre types to read" parameter of your database reader. If the syntax is different (e.g. they chose roadsegment but the table name is road.segment)  you could use a scripted parameter to map the name the user choses to the actual table name in your database. For this to work the source feature type for the database reader must "Merge Feature Types" checked with a wildcard so all possible tables can be read throught it. Or you need to have all possible database source feature types in the workspace.

 

 

 


Reply