<< Click to Display Table of Contents >> Navigation: iVend Database Database > Views > vw_ProductMerchandiseHierarchy View |
Navigation: iVend Database Database > Views >
iVend 6.6 Database Help
vw_ProductMerchandiseHierarchy View
Collapse All Expand All
iVend Database Database : vw_ProductMerchandiseHierarchy View |
Properties
Creation Date |
4/13/2015 12:00 PM |
Is Schema Bound |
|
Encrypted |
|
Ansi Nulls |
Columns
|
Column Name |
Description |
Datatype |
Length |
Allow Nulls |
Default |
Formula |
|
ProductKey |
|
BigInt |
8 |
|
|
|
|
HierarchyKey |
|
BigInt |
8 |
|
|
|
|
Level1 |
|
VarWChar |
50 |
|
|
|
|
Level2 |
|
VarWChar |
50 |
|
|
|
|
Level3 |
|
VarWChar |
50 |
|
|
|
|
Level4 |
|
VarWChar |
50 |
|
|
|
|
Level5 |
|
VarWChar |
50 |
|
|
|
|
Level6 |
|
VarWChar |
50 |
|
|
|
|
Level7 |
|
VarWChar |
50 |
|
|
|
|
Level8 |
|
VarWChar |
50 |
|
|
|
|
Level9 |
|
VarWChar |
50 |
|
|
|
|
Level10 |
|
VarWChar |
50 |
|
|
|
|
Level11 |
|
VarWChar |
50 |
|
|
|
|
Level12 |
|
VarWChar |
50 |
|
|
|
|
Level13 |
|
VarWChar |
50 |
|
|
|
|
Level14 |
|
VarWChar |
50 |
|
|
|
|
Level15 |
|
VarWChar |
50 |
|
|
Objects that depend on vw_ProductMerchandiseHierarchy
|
Database Object |
Object Type |
Description |
Dep Level |
View |
|
1 |
||
View |
|
1 |
||
View |
|
1 |
Objects that vw_ProductMerchandiseHierarchy depends on
|
Database Object |
Object Type |
Description |
Dep Level |
Table |
Detail table for saving the merchandise Hierarch tree details. |
1 |
||
Table |
Stores the product related details. |
1 |
||
Table |
Stores the values related to a defined Merchandise hirarchy for a product |
1 |
View Definition
CREATE View [dbo].[vw_ProductMerchandiseHierarchy] As With CTE As ( Select InvProduct.ProductKey, InvProductMerchandiseHierarchy.HierarchyKey, InvMerchandiseHierarchyDetail.Name, InvMerchandiseHierarchyDetail.ParentNodeKey, InvMerchandiseHierarchyDetail.HierarchyLevel From InvProduct Inner Join InvProductMerchandiseHierarchy On InvProduct.ProductKey = InvProductMerchandiseHierarchy.ProductKey Inner Join InvMerchandiseHierarchyDetail On InvProductMerchandiseHierarchy.HierarchyDetailKey = InvMerchandiseHierarchyDetail.HierarchyDetailKey Union All Select CTE.ProductKey, CTE.HierarchyKey, InvMerchandiseHierarchyDetail.Name, InvMerchandiseHierarchyDetail.ParentNodeKey, InvMerchandiseHierarchyDetail.HierarchyLevel From InvMerchandiseHierarchyDetail Inner Join CTE On InvMerchandiseHierarchyDetail.HierarchyDetailKey = CTE.ParentNodeKey ) Select * From ( Select InvProduct.ProductKey, HierarchyKey, Name, HierarchyLevel='Level' + Cast(HierarchyLevel as varchar(2)) From InvProduct Left Outer Join CTE On InvProduct.ProductKey = CTE.ProductKey ) As temp PIVOT ( Max(Name) FOR [HierarchyLevel] IN (Level1,Level2,Level3,Level4,Level5,Level6,Level7,Level8,Level9,Level10,Level11,Level12,Level13,Level14,Level15) )AS RESULT |
See Also
© 2019 All Rights Reserved.
Send comments on this topic.