Skip to main content
Question

WHERE clauses in FME

  • June 14, 2013
  • 7 replies
  • 2437 views

Hello,

 

 

I am a basic user of FME and have created a workbench merging many tables. I need to add a further table, but before I use the FeatureMerger I need to specifiy a WHERE clause on the reader. I have tried doing thison the reader with no joy. I have also tried with the FeatureReader and no joy. I cannot find any help documentation in the reader to help me with syntax. Is there a simple transformer I can use?

 

 

I need a very simple clause to pass only certain attributes from one of the fields into the next transformer.

 

 

Can someone assist please?

 

Harriet
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

7 replies

owen
Forum|alt.badge.img+1
  • 156 replies
  • June 14, 2013
Hi Harriet, 

 

 

I think it needs to be a format that supports querying, like a database.

 

 

Alternatively, you could use a tester

 

 

Owen

takashi
Celebrity
  • 7843 replies
  • June 14, 2013
Hi Harriet,

 

 

You can use general SQL syntax for the WHERE Clause. For example: num = 100 country = 'Japan'   Naturally, relation operators (<, > etc.) and logical operators (and, or) also can be used. 

 

Takashi

Hi Harriet,

 

 

you could give the SQLExecuter a try and here is more information about SQL.

 

 

http://www.w3schools.com/sql/sql_where.asp

 

 

Best regards,

 

Stefan

  • Author
  • 1 reply
  • June 14, 2013
Hello,

 

 

Tester! Yes it worked perfectly! I knew it must be simple! Thanks very much guys!

david_r
Celebrity
  • 8392 replies
  • June 14, 2013
Hi,

 

 

if you have lots of data in your table and you only use a small part, be aware that the Tester will me much slower and will consume a lot more memory than a proper where-clause, as FME will have to pull all the data to your desktop, rather than letting the database filter it for you at the source.

 

 

If you post your where-clause here (as well as the type of reader it is), we might perhaps be able to help you using it.

 

 

David

Forum|alt.badge.img+4
  • 30 replies
  • August 18, 2015
@Takashi, every time I Google a question about FME, this Knowledge Center is almost always one of the results, and you are almost always the one with the answer. Thanks for your contributions!

davidmooney
Contributor
Forum|alt.badge.img+5
  • Contributor
  • 8 replies
  • February 25, 2022

Smallworld 4/5 Reader

Here is some documentation for anyone who has the same question but is using a Smallworld 4/5 Reader.

Example: I want to read records from the collection named eo_power_xfrmr_inst with a device_type of "Underground"

WHERE clause: [Electric]eo_power_xfrmr_inst WHERE device_type = "Underground"

 

General formatting: [Dataset]<collection_name> WHERE <field_name> = "???"