Skip to main content
8-Gravel
October 14, 2025
Question

Issue in extracting as stored BOM from windchill DB using SQL query

  • October 14, 2025
  • 1 reply
  • 1597 views

Version: Windchill 12.1

 

Use Case: Version: Windchill 12.1 Use Case: We are trying to Extract Windchill As-stored BOM Information from Windchill DB, We are not finding the child information instead of same parent information is repeated equals to child rows.


Description:

Version: Windchill 12.1

Use Case: We are trying to Extract Windchill As-stored BOM Information from Windchill DB, We are not finding the child information instead of same parent information is repeated equals to child rows.

Please check attachment for the query used and the result.

1 reply

HelesicPetr
22-Sapphire II
22-Sapphire II
October 14, 2025

Hi @Vignesh_AJ_77 

I guess that it is common issue if the object is check-outed. Then by your conditions you always get two result rows

PetrH

8-Gravel
October 14, 2025

Hi @HelesicPetr 
Thanks for your response. The data is not checkedout. And also we are seeing two result rows for the parent item. They are supposed to be the child items instead of parent. 

8-Gravel
October 15, 2025

We tried the below query again today and it returned parent's version and iteration instead of children's:

SELECT parent_dm.CADName as Parent_Cadname, 
parent_doc.idA2A2 AS ParentDocID, 
parent_doc.versionIdA2versionInfo as Parent_Version, 
parent_doc.iterationIdA2iterationInfo as Parent_iteration, 
child_doc.versionIdA2versionInfo as Child_Version,
child_doc.iterationIdA2iterationInfo as Child_iteration,
ml.idA2A2 AS LinkID, 
ml.idA3B5 AS ChildMasterID,
child_dm.CADName as Child_Cadname

 

FROM pdmlink.EPMDocument parent_doc
JOIN pdmlink.EPMDocumentMaster parent_dm 
  ON parent_doc.idA3masterReference = parent_dm.idA2A2

 

JOIN pdmlink.EPMMemberLink ml 
  ON ml.idA3A5 = parent_doc.idA2A2

JOIN pdmlink.EPMAsStoredMember asstored 
  ON asstored.idA3B5 = ml.idA3A5

 

JOIN pdmlink.EPMAsStoredConfig as config
ON config.idA2A2 = asstored.idA3A5

 

JOIN pdmlink.EPMDocumentMaster child_dm
    ON ml.idA3B5 = child_dm.idA2A2

 

JOIN pdmlink.EPMDocument child_doc
ON asstored.idA3B5 = child_doc.idA2A2     --This gives parent's version and iteration which is incorrect--

 

--JOIN pdmlink.EPMDocument child_doc1
--ON child_doc1.idA3masterReference = child_dm.idA2A2 --This gives both iterations of child 2 which is incorrect--

 

WHERE parent_dm.CADName = '13_oct_assy_1.asm'
  AND parent_doc.versionIdA2versionInfo = 'P1'
  AND parent_doc.iterationIdA2iterationInfo = '2'
  ORDER BY parent_dm.CADName;

--- We also tried to point the filter to children somehow using below subquery in between, but that did not work either:

 

AND child_doc.idA2A2 = (
    SELECT child_doc.idA2A2
    FROM pdmlink.EPMDocument
    WHERE child_doc.idA3masterReference = ml.idA3B5 
  )

Could you please check and advise how to proceed? 

Vignesh_AJ_77_0-1760545600218.png