1

I wonder, is there any way to implement exist logic using PDI like in Query Script below
EXIST (SELECT a.product FROM store a, struck b WHERE b.product = a.product) to check is the data exist in files (CSV)?

I know PDI has provide design tools like Table Exist, File Exist and Check if a column exist but that tools only work in DB Table and File not data inside the File.

Rio Odestila
  • 125
  • 2
  • 19

1 Answers1

1

You can count the records in the file (or sql, or REST client, or,...) and filter only if it is not zero.

enter image description here

AlainD
  • 6,187
  • 3
  • 17
  • 31
  • okay, look at this Script `WHERE x.prdcd IS NOT NULL AND EXISTS (SELECT p.productid FROM product_filter p WHERE x.prdcd = p.productid) AND NOT (x.qty = 0 AND t.productid IS NULL);` and this is what I write `https://imgur.com/a/yN8873X` It's correct? – Rio Odestila Jul 11 '18 at 01:36
  • You only, as data owner, can say if it's true after a test. But it's a rather sqly answer. – AlainD Jul 11 '18 at 09:32