Developer forum

Forum » Development » ecommerce - tabel ecomproducts

ecommerce - tabel ecomproducts


Reply
Hey DW's

When we pull data from table 'ecomproducts' there is no column with product-group, so we can not see the product group, which the product is put in.

Is this possible to see this? or / and it can be done to create your own "data list", which is mixed with all the tables you want a given XML feed?

Replies

 
Nicolai Høeg Pedersen
Reply
Product and Groups are a many-to-many relation and there is a table between the to entities called EcomGroupProductRelation that you have to look in to find its group association.

So you need EcomGroups joined on EcomGroupProductRelation joined on EcomProducts.

Like this:
SELECT EcomGroups.GroupID, EcomGroups.GroupNumber, EcomGroups.GroupName, EcomProducts.ProductID, EcomProducts.ProductNumber, EcomProducts.ProductName
FROM (EcomGroupProductRelation INNER JOIN EcomGroups ON EcomGroupProductRelation.GroupProductRelationGroupID = EcomGroups.GroupID) INNER JOIN EcomProducts ON EcomGroupProductRelation.GroupProductRelationProductID = EcomProducts.ProductID
WHERE EcomGroups.GroupNumber="MyGroupNumber"

And you can use datalists with a custom view to specify the SQL.
 
Reply
hi Nicolai,

thanks for the answer.

but when I use the SQL statement, the list says "no data". is there some setup or preparations I have to make?

thanks
//Peter Bille
 
Nicolai Høeg Pedersen
Reply
You have to change the "MyGroupNumber" in the where clause with a groupnumber you have - or remove the where clause to get all the products...
 
Reply
awesome, awesome.. I got it.

now its easy to make a custom datalist of all the tables in the DB i guess? .if they can be joined.

thanks! :-)

 

You must be logged in to post in the forum