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?
Developer forum
E-mail notifications
ecommerce - tabel ecomproducts
Posted on 31/08/2010 13:26:21
Replies
Nicolai Høeg Pedersen
Posted on 31/08/2010 13:34:54
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.
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.
Posted on 31/08/2010 13:58:49
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
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
Posted on 31/08/2010 14:02:04
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...
Posted on 31/08/2010 14:10:38
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! :-)
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