Sample Queries
Run the provided queries by substituting the strings:
-
'xx'
with your appropriate language code('ez', 'ee', 'fr', etc.)
For example, the tablecds_stdnxx
, would becds_stdnez
if you receive English language with Imperial Units. -
'PRODUCTID'
with with your appropriateProdID
,
which would either be your internal part number(PULL delivery mode)
orDataSource SKUID (PUSH/SYNCHRO delivery modes)
Main Specifications
v.text AS Header,
v2.text AS Body
FROM cds_mspecxx m
JOIN cds_mvocxx v
ON m.hdrid = v.id
JOIN cds_mvocxx v2
ON m.bodyid = v2.id
WHERE m.prodid = 'PRODUCTID'
ORDER BY m. prodid,
m.displayorder;
Extended Specifications
v.text AS Sector,
v2.text AS Header,
v3.text AS Body
FROM cds_especxx e
JOIN cds_evocxx v
ON e .sectid = v .id
JOIN cds_evocxx v2
ON e .hdrid = v2 .id
JOIN cds_evocxx v3
ON e.bodyid = v3.id
WHERE e .prodid = 'PRODUCTID'
ORDER BY e.prodid ,
e .displayorder
Attributes / Values / Units
-- SQL Server
v.text AS Attribute,
a.valid AS ValueID,
a.unitid AS UnitID,
v3.text AS Unit,
COALESCE( v2.text + ' ' + v3. text, v2. text) AS ValueUnit ,
a. nnv
FROM cds_atr a
JOIN cds_vocxx v
ON a.atrid = v. id
JOIN cds_vocxx v2
ON a.valid = v2. id
LEFT JOIN cds_vocxx v3
ON a .unitid = v3 .id
WHERE a. prodid = 'PRODUCTID'
ORDER BY a .atrid
-- MySQL
v.text AS Attribute,
a.valid AS ValueID,
a.unitid AS UnitID,
v3.text AS Unit,
CASE
WHEN v3 .text IS NULL THEN v2.text
ELSE Concat_ws ("", v2 .text, v3 .text)
END AS ValueUnit,
a. nnv
FROM cds_atr a
JOIN cds_vocxx v
ON a.atrid = v. id
JOIN cds_vocxx v2
ON a.valid = v2. id
LEFT JOIN cds_vocxx v3
ON a .unitid = v3 .id
WHERE a. prodid = 'PRODUCTID'
ORDER BY a .atrid
Product Line and Model
v.text AS ProductLine,
v2.text AS Model
FROM cds_atr a
JOIN cds_vocxx v
ON a.valid = v.id
LEFT JOIN cds_atr a2
ON a.prodid = a2.prodid
AND a2.atrid = 'A00601'
LEFT JOIN cds_vocxx v2
ON a2.valid = v2.id
WHERE a.prodid = 'PRODUCTID'
AND a.atrid = 'A00600';
Standardized Description
std.description AS Standardized_Description
FROM cds_prod p
JOIN cds_stdnxx std
ON p .prodid = std .prodid
WHERE p. prodid = 'PRODUCTID'
Short Product Description
v.text AS Short_Description
FROM cds_prod p
JOIN cds_mspecxx m
ON m .prodid = p .prodid
JOIN cds_mvocxx v
ON m .bodyid = v .id
WHERE p. prodid = 'PRODUCTID'
AND m .displayorder = 1
640×480 Image
dcl.contentguid,
dc.url,
dcmv.metavaluename AS resolution
FROM cds_digcontent dc
JOIN cds_digcontent_links dcl
ON dc.contentguid = dcl.contentguid–– resolutionjoin cds_digcontent_meta dcm
ON dcm.contentguid = dc.contentguid
AND dcm.metaatrid = 6
JOIN cds_digcontent_meta_valvoc dcmv
ON dcmv.metavalueid = dcm.metavalueid
WHERE dc.mediatypeid=15
AND dcl.prodid = 'PRODUCTID'
AND dcmv.metavaluename = '640 x 480'
Image Meta Attributes
FROM cds_digcontent_meta_atrvoc
ORDER BY metaatrid
Image Resolution / Angle / Type
dcl.contentguid ,
dc.url ,
dcmv.metavaluename AS Resolution,
dcmv2.metavaluename AS Angle,
dcmv3. metavaluename AS Image_type
FROM cds_digcontent dc
JOIN cds_digcontent_links dcl
ON dc .contentguid = dcl .contentguid
-- resolution
JOIN cds_digcontent_meta dcm
ON dcm .contentguid = dc.contentguid
AND dcm.metaatrid = 6
JOIN cds_digcontent_meta_valvoc dcmv
ON dcmv.metavalueid = dcm. metavalueid
-- type
JOIN cds_digcontent_meta dcm3
ON dcm3.contentguid = dc. contentguid
AND dcm3 .metaatrid = 2
JOIN cds_digcontent_meta_valvoc dcmv3
ON dcmv3 .metavalueid = dcm3 .metavalueid
-- angle
LEFT JOIN cds_digcontent_meta dcm2
ON dcm2 . contentguid = dc . contentguid
AND dcm2 . metaatrid = 1
LEFT JOIN cds_digcontent_meta_valvoc dcmv2
ON dcmv2 . metavalueid = dcm2 . metavalueid
WHERE dc . mediatypeid = 15
AND dcl . prodid = 'PRODUCTID'
ORDER BY resolution ,
angle
Primary Image by Product
dcl.contentguid ,
dc.url ,
dcmv.metavaluename AS Resolution,
dcmv2.metavaluename AS Weight
FROM cds_digcontent dc
JOIN cds_digcontent_links dcl
ON dc .contentguid = dcl .contentguid
-- resolution
JOIN cds_digcontent_meta dcm
ON dcm .contentguid = dc.contentguid
AND dcm.metaatrid = 6
JOIN cds_digcontent_meta_valvoc dcmv
ON dcmv.metavalueid = dcm. metavalueid
-- weight
JOIN cds_digcontent_meta dcm2
ON dcm2.contentguid = dc. contentguid
AND dcm2 .metaatrid = 7
JOIN cds_digcontent_meta_valvoc dcmv2
ON dcmv2 .metavalueid = dcm2 .metavalueid
JOIN ( SELECT dcl .prodid ,
dcmv . metavaluename AS resolution ,
Max ( dcmv2 . metavaluename ) AS weight
FROM cds_digcontent dc
JOIN cds_digcontent_links dcl
ON dc . contentguid = dcl . contentguid
-- resolution
JOIN cds_digcontent_meta dcm
ON dcm . contentguid = dc . contentguid
AND dcm . metaatrid = 6
JOIN cds_digcontent_meta_valvoc dcmv
ON dcmv . metavalueid = dcm . metavalueid
-- weight
JOIN cds_digcontent_meta dcm2
ON dcm2 . contentguid = dc . contentguid
AND dcm2 . metaatrid = 7
JOIN cds_digcontent_meta_valvoc dcmv2
ON dcmv2 . metavalueid = dcm2 . metavalueid
WHERE dc . mediatypeid = 15
AND dcl . prodid = 'PRODUCTID'
GROUP BY dcl . prodid ,
dcmv . metavaluename ) max_weight
ON max_weight . resolution = dcmv . metavaluename
AND max_weight . weight = dcmv2 . metavaluename
WHERE dc . mediatypeid = 15
AND dcl . prodid = 'PRODUCTID'
ORDER BY weight DESC ,
resolution DESC
Primary Image All Products
dcl.contentguid,
dc.url,
dcmv.metavaluename asresolution,
dcmv2.metavaluenameasweight
FROM cds_catalogasp
JOIN cds_digcontent_linksdcl
ON dcl.prodid=p.prodid
JOIN cds_digcontentdc
ON dc.contentguid=dcl.contentguid
-- resolution
JOIN cds_digcontent_metadcm
ON dcm.contentguid=dc.contentguid anddcm.metaatrid=6
JOIN cds_digcontent_meta_valvocdcmv
ON dcmv.metavalueid=dcm.metavalueid
-- weight
JOIN cds_digcontent_metadcm2 ond cm2.contentguid=dc.contentguid
AND dcm2.metaatrid=7
JOIN cds_digcontent_meta_valvocdcmv2
ON dcmv2.metavalueid=dcm2.metavalueid
JOIN (selectdcl.prodid, max(dcmv.metavaluename)asweight FROM cds_catalogasp
JOIN cds_digcontent_linksdcl
ON dcl.prodid=p.prodid
JOIN cds_digcontentdc
ON dc.contentguid=dcl.contentguid
-- weight
JOIN cds_digcontent_metadcm
ON dcm.contentguid=dc.contentguid anddcm.metaatrid=7
JOIN cds_digcontent_meta_valvocdcmv
ON dcmv.metavalueid=dcm.metavalueid WHERE dc.mediatypeid=15 GROUP BY dcl.prodid)asmax_weight
ON max_weight.weight=dcmv2.metavaluename
AND max_weight.prodid=p.prodid
WHERE dc.mediatypeid=15
ORDER BY prodid,
resolution
Image by ImageID
dcl.contentguid ,
dcmv.metavaluename AS Resolution,
dcmv3.metavaluename AS Image_ID
FROM cds_digcontent dc
JOIN cds_digcontent_links dcl
ON dc .contentguid = dcl .contentguid
-- resolution
JOIN cds_digcontent_meta dcm
ON dcm .contentguid = dc .contentguid
AND dcm.metaatrid = 6
JOIN cds_digcontent_meta_valvoc dcmv
ON dcmv.metavalueid = dcm. metavalueid
-- image id
JOIN cds_digcontent_meta dcm3
ON dcm3.contentguid = dc. contentguid
AND dcm3. metaatrid = 8
JOIN cds_digcontent_meta_valvoc dcmv3
ON dcmv3 .metavalueid = dcm3 .metavalueid
WHERE dc. mediatypeid = 15
AND dcl .prodid = 'PRODUCTID'
ORDER BY image_id ,
resolution
Default Image
SELECT DISTINCT p. catid,
dcl. contentguid,
dc .url,
dcmv .metavaluename AS resolution ,
dcmv2 .metavaluename AS default_image
FROM cds_digcontent dc
JOIN cds_digcontent_links dcl
ON dc .contentguid = dcl .contentguid
JOIN cds_prod p
ON p .prodid = dcl.prodid
-- resolution
JOIN cds_digcontent_meta dcm
ON dcm.contentguid = dc. contentguid
AND dcm.metaatrid = 6
JOIN cds_digcontent_meta_valvoc dcmv
ON dcmv.metavalueid = dcm. metavalueid
-- image Type
JOIN cds_digcontent_meta dcm2
ON dcm2 .contentguid = dc .contentguid
AND dcm2 .metaatrid = 2
JOIN cds_digcontent_meta_valvoc dcmv2
ON dcmv2 . metavalueid = dcm2 . metavalueid
WHERE dc . mediatypeid = 15
AND dcmv2 . metavaluename = 'No image available'
ORDER BY p . catid ,
resolution
Marketing Text / Key Selling Points / Product Features / What's in the box
SELECT l.prodID,
c.contentguid ,
c.url ,
c.mediatypeid,
lal.languagecode
FROM cds_digcontent_links l
JOIN cds_digcontent c
ON l .contentguid = c .contentguid
JOIN cds_digcontent_lang_links lal
ON lal.contentguid = c.contentguid
WHERE l. prodid = 'PRODUCTID'
AND c.mediatypeid in (4,5,14,10)
ORDER BY c .mediatypeid
PDFs
-- MediaTypeID 12 = User Manual
-- MediaTypeID 13 = Quick Start guide
SELECT l.prodid ,
c.contentguid ,
c.url ,
c.mediatypeid ,
lal.languagecode
FROM cds_digcontent_links l
JOIN cds_digcontent c
ON l .contentguid = c .contentguid
JOIN cds_digcontent_lang_links lal
ON lal .contentguid = c .contentguid
WHERE l. prodid = 'PRODUCTID'
AND c .mediatypeid IN ( 11, 12, 13 )
ORDER BY c.mediatypeid
Manufacturer Logo
c.contentguid ,
c.url ,
dcmv.metavaluename AS Resolution
FROM cds_digcontent_links l
JOIN cds_digcontent c
ON l .contentguid = c .contentguid
JOIN cds_digcontent_meta dcm
ON dcm .contentguid = c .contentguid
AND dcm.metaatrid = 6
JOIN cds_digcontent_meta_valvoc dcmv
ON dcmv.metavalueid = dcm. metavalueid
WHERE l .prodid = 'PRODUCTID'
AND c.mediatypeid = 17
Accessories
l.prodid AS Accessory
FROM cds_acc_links l
WHERE l.pprodid = 'PRODUCTID'
Compatibility Rules
v2.text AS ParentModel,
cpl.applicablecondition ,
cpl.details
FROM cds_acccompat acc
JOIN cds_vocxx v
ON v .id = acc .pproductline
LEFT JOIN cds_vocxx v2
ON v2.id = acc.pmodel
LEFT JOIN cds_acccompat_complement_xx cpl
ON cpl.complementid = acc.complementid
WHERE acc. prodid = 'ProductID' --Accessory ProdID
Alternative Categorization
SELECT *
FROM cds_cct_categories;
-- Different level of categorization for a product
SELECT p.prodid ,
p.catid ,
v.categoryname ,
p.isprimary ,
languageid,
c.breadcrumbs
FROM cds_cct_products p
JOIN cds_cct_vocabulary v
ON v .catid = p .catid
JOIN cds_cct_categories c
ON c .catid = p .catid
WHERE p. prodid = 'PRODUCTID'
ORDER BY Length (p.catid ),
p .catid
Alternative Searchable Attributes
ac.categoryname AS category_name,
ac.atrid AS attribute_ID,
ac.attributename AS attribute_name,
v.description AS value_range,
v. languagecode
FROM cds_asa_cat ac
JOIN cds_asa_ranges_metric arm
ON arm .rangecode = ac .rangecode
JOIN cds_asa_voc v
ON v.id = arm.rangevalueid
WHERE ac .atrid = 'A00040' --Processor Speed
AND v.languagecode = 'EN'
Alternative Categorization Primary Category Last Level
c.catid ,
v.categoryname
FROM (SELECT p.prodid,
Max (p.catid) AS maxcatid
FROM cds_cct_products p
INNER JOIN cds_cct_categories c
ON c.catid = p.catid
WHERE p .isprimary = 1
GROUP BY p.prodid) pc
INNER JOIN cds_cct_categories c
ON c. catid = maxcatid
INNER JOIN cds_cct_vocabulary v
ON v. catid = maxcatid
WHERE languageid = 'en'
Distributor Part Number
SELECT m.prodid ,
m.distisku AS DistributorPN
FROM cds_metamap m
WHERE m.prodid = 'PRODUCTID'
AND m. distiid = 'Distributor ID'
UPC / EAN code
SELECT m.prodid ,
m.distisku AS UPCEAN_Code
FROM cds_metamap m
WHERE m.prodid = 'PRODUCTID'
AND m. distiid = 'UPCEAN Account ID'
Generate an XML list of Digital Content for a specific product
The Stored Procedure generates an XML document containing a list of all Digital Content for the specified product and language, including URLs to the content itself. This query can easily be converted into a User Defined Function and used in the select list of another query in order to return a list of XML documents from a list of Product IDs.