Skip to main content
Question

Given 2 Table A and B: How do I find records in A not found in B?


Forum|alt.badge.img
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"

 

 

 

4 replies

david_r
Celebrity
  • May 27, 2013
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

Forum|alt.badge.img
  • Author
  • May 27, 2013
Thanks David. 

 

 

That might work. kudos for inverse usage of FeatureMerge.

jasonbirch
Contributor
Forum|alt.badge.img+5
  • Contributor
  • May 28, 2013
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

david_r
Celebrity
  • May 28, 2013
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

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings