Skip to main content
Hi,

 

 

I have table A and B with the same primary key.

 

 

How do I find all the records in that from A that does not exist in B?

 

 

Basically B consider of tables migrated and A is the original table. I wish to find all the record that I miss out or have errors after the "run"

 

 

 

Hi,

 

 

the easiest is probably to use the FeatureMerger. Set the primary key as the merge attribute, with table A as Requestor and table B as the Supplier.

 

 

Features from table A (the requestor) that does not exist in table B (the supplier) will be output from the Incomplete port.

 

 

David
Thanks David. 

 

 

That might work. kudos for inverse usage of FeatureMerge.
This is a case where using SQL you'd typically want to perform a left join using the shared pk and only include the rows where the right side pk is null. I'd probably use a FeatureMerger too, but other options could include a source query (if you're running this as a second job once the translation completes and if the data is in a format that allows this) or to use the InlineQuerier which is super cool and powerful. Jason
Hi Jason,

 

 

agree with you completely regarding the join-based solution. Personally, I tend to prefer doing these things as much as possible in the database, e.g. using a SQLCreator. The performance gains can be substantial for larger datasets compared to pulling everything into FME to do the processing on the client side.

 

 

Regarding the InlineQuerier, though, it has been my experience that it is not always worth the extra complexity it introduces, except in some special cases (where it really excels). YMMV, caveat emptor, and all that...

 

 

David

Reply