Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am loading one table: productsA and want to load the other tables only when the Product_ID exists in the first table because the other tables have many posts that has nothing to do with productsA. How is the load syntax for that?
//Liivi
No it looks at all the already loaded ProductID's. If you only want to check against the ProductID's from the firstly loaded table but not other loaded ProductID's (if you load data between the two) you can load it with an alias, I.e:
Products:
Load
ProductID
ProductID as MyProductID,
ProductNM;
SQL SELECT ProductID, ProductNM
FROM MyTable;
ProductSpecification:
Load
ProductID,
ProductWeight
WHERE EXISTS(ProductID, MyProductID);
SQL SELECT ProductID, ProductWeight
FROM MyOtherTable;
Writing syntax from memory but something like this should work.
Products:
Load
ProductID,
ProductNM;
SQL SELECT ProductID, ProductNM
FROM MyTable;
ProductSpecification:
Load
ProductID,
ProductWeight
WHERE EXISTS(ProductID);
SQL SELECT ProductID, ProductWeight
FROM MyOtherTable;
/Michael
But in this syntax you don't specify that the product_ID that I load from other table must exixt in the first table
Yes I do. I explicitly state that ProductId must exist in the already loaded data. Hence the bold part.
As it seems it worked,
but what happens if I want to load more tables with this sytnax, does it always look on the product_ID in the first table?
No it looks at all the already loaded ProductID's. If you only want to check against the ProductID's from the firstly loaded table but not other loaded ProductID's (if you load data between the two) you can load it with an alias, I.e:
Products:
Load
ProductID
ProductID as MyProductID,
ProductNM;
SQL SELECT ProductID, ProductNM
FROM MyTable;
ProductSpecification:
Load
ProductID,
ProductWeight
WHERE EXISTS(ProductID, MyProductID);
SQL SELECT ProductID, ProductWeight
FROM MyOtherTable;
Thanx a lot!!!