Product Attribute Segment Data Source Strategy
Q: I have source attribute data that looks like the following:
| PartNumber | Color | Texture |
|---|---|---|
| P1 | Red | Smooth |
| P2 | Blue | Rough |
What should my SQL look like to allow PIESCentral to load this data?
A: The query will look like this:
select [PartNumber], 'Color' as AttributeID, [Color] as AttributeData from Parts
union
select [PartNumber], 'Texture' as AttributeID, [Texture] as AttibuteData from Parts
This will produce the following:
| PartNumber | AttributeID | AttributeData |
|---|---|---|
| P1 | Color | Red |
| P1 | Texture | Smooth |
| P2 | Color | Blue |
| P2 | Texture | Rough |
Just repeat the above pattern, with one select for each attribute, separating the selects with ‘union’.
Revised: 2013-09-24
Copied!