在SQL数据库中查询Smart3D中pipeline的层级关系
下面首先需要新增split函数
摘自:
https://www.cnblogs.com/hantianwei/archive/2010/07/05/1771571.html
有了该函数之后,我们就可以对查询得到的字符串结果进行split处理。
下面我们基于上面的结果已经新建的split函数,完成创建视图
“select
dbo.splitstring(dbo.REPORTGetHierarchyPathByChildOid(pipeline.Oid, 'SystemHierarchy') ,'\',1) as path1,
dbo.splitstring(dbo.REPORTGetHierarchyPathByChildOid(pipeline.Oid, 'SystemHierarchy') ,'\',2) as path2,
dbo.splitstring(dbo.REPORTGetHierarchyPathByChildOid(pipeline.Oid, 'SystemHierarchy') ,'\',3) as path3,
dbo.splitstring(dbo.REPORTGetHierarchyPathByChildOid(pipeline.Oid, 'SystemHierarchy') ,'\',4) as path4,
dbo.splitstring(dbo.REPORTGetHierarchyPathByChildOid(pipeline.Oid, 'SystemHierarchy') ,'\',5) as path5,
dbo.splitstring(dbo.REPORTGetHierarchyPathByChildOid(pipeline.Oid, 'SystemHierarchy') ,'\',6) as path6,
dbo.splitstring(dbo.REPORTGetHierarchyPathByChildOid(pipeline.Oid, 'SystemHierarchy') ,'\',7) as path7,
dbo.splitstring(dbo.REPORTGetHierarchyPathByChildOid(pipeline.Oid, 'SystemHierarchy') ,'\',7) as path8
,n1.ItemName as 'LineName', pipeline.Oid as 'LineOid'
from JPipelineSystem pipeline
join JNamedItem n1 on n1.Oid = pipeline.Oid
”
保存视图后,新建查询
select * from ACV_PipelineSystemPath
相关阅读