Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Everyone!
What I need is to condition the load of a table if one of its fields exists in another preloaded table.
Eg: I've a PRODUCT table and another one with STOCKS. So, I want to load just the rows of STOCK where the PRODUCT exists in the main table (product). SOmething like:
/******************* PRODUCTO ********************//
PRODUCT:
Load CO_PRODUCT,
NA_PRODUCT,
FROM QvD\PRODUCT.QVD (qvd);
//******************* VSTOCK ART ********************//
VSTOCK_ART:
Load co_enterprise,
co_art,
co_art AS CO_PRODUCT,
FROM QvD\VSTOCK_ART.QVD (qvd)
WHERE co_art EXISTS PRODUCT; ??????????????????????????????????????????????
I bet it's a pretty easy thing to do... riight? [:^)]
Thxs in advance!
WHERE EXISTS(CO_PRODUCT,co_art)
Take care,
Justinas
Hi Justinas! thxs for your answer..
I've implemented and i've an inquire about it.
I have the same name field (CO_PRODUCT) in other tables, it's a key one, so.. how do I delimitated the EXISTS clause to only the master table (in this case, the PRODUCT table)? ? ?
Ideas?
Thxs in advance..
A couple ideas. I'm sure there are a lot of other ways.
leonor.ferrebuz wrote:
I have the same name field (CO_PRODUCT) in other tables, it's a key one, so.. how do I delimitated the EXISTS clause to only the master table (in this case, the PRODUCT table)? ? ?
Load the PRODUCT table first. On every subsequent load, specify WHERE EXISTS(CO_PRODUCT). You will never load another value of CO_PRODUCT that didn't exist in PRODUCTS.
-Rob
Ook! thxs...
At the end what I did was:
WHERE EXISTS (CO_PRODUCT,co_art); Because in this table the cod of the product doesnt have the same name than the one in the main table (co_art). I'm still verifying that the filter is working as it should.
To be "sure" of wich CO_PRODUCT it's taking, I created an auxiliar field, and because of the table is qualify I do:
WHERE EXISTS (PRODUCT.CO_PROD_AUX,co_art);
Thxs for your answer!