Skip to main content
6-Contributor
October 13, 2026
Solved

“SQL query to list WTDocuments with primary and secondary content across all revisions.

What product version are you running?
windchill 13.0.2

Describe the Problem

I referred to PTC article CS295658 for the Query Builder report listing WTDocuments with links to download primary and secondary content.

However, report generation is taking a long time, and the Method Server has restarted multiple times while the report is running. Could you please provide an

Article - CS295658 - [QML] Query Builder Report listing WTDocuments with links to download primary and secondary content in Windchill PDMLink

SQL query to retrieve WTDocument primary and secondary content details across all revisions?

 


Are you using a work around?
Article - CS295658 - [QML] Query Builder Report listing WTDocuments with links to download primary and secondary content in Windchill PDMLink

What is the use case for your organization?
Generate a report listing WTDocuments with primary or secondary content across all revisions.”

What impact does this problem currently have on your organization?
Generate a report listing WTDocuments with primary or secondary content across all revisions.”

MjayAnswer
6-Contributor
October 15, 2026

Thank you! This really helped me generate the query.

SELECT

    A0B.name AS "Document Name",

    A0B.WTDocumentNumber AS "Document Number",

    A1.fileName AS "Content Name",

    A1.role AS "Content Role",

    A0.VERSIONIDA2VERSIONINFO AS "Version ID",

    A0.VERSIONLEVELA2VERSIONINFO AS "Version Level",

    A0.ITERATIONIDA2ITERATIONINFO AS "Iteration Number",

    A0.LATESTITERATIONINFO AS "Latest Iteration"

FROM

    WTDocument A0,

    WTDocumentMaster A0B,

    ApplicationData A1,

    HolderToContent A2

WHERE

    A0.idA3masterReference = A0B.idA2A2

    AND A2.idA3A5 = A0.idA2A2

    AND A2.idA3B5 = A1.idA2A2

    AND A0.LATESTITERATIONINFO = 1

ORDER BY

    A0B.WTDocumentNumber,

    A0.VERSIONSORTIDA2VERSIONINFO;

2 replies

MarcoTosin
21-Topaz II
October 14, 2026

Have you already tried using the method described in this article to create your SQL query?

 

How to get the SQL statement of the Query Builder Report
 

 

Translate
Marco
Mjay6-ContributorAuthorAnswer
6-Contributor
October 15, 2026

Thank you! This really helped me generate the query.

SELECT

    A0B.name AS "Document Name",

    A0B.WTDocumentNumber AS "Document Number",

    A1.fileName AS "Content Name",

    A1.role AS "Content Role",

    A0.VERSIONIDA2VERSIONINFO AS "Version ID",

    A0.VERSIONLEVELA2VERSIONINFO AS "Version Level",

    A0.ITERATIONIDA2ITERATIONINFO AS "Iteration Number",

    A0.LATESTITERATIONINFO AS "Latest Iteration"

FROM

    WTDocument A0,

    WTDocumentMaster A0B,

    ApplicationData A1,

    HolderToContent A2

WHERE

    A0.idA3masterReference = A0B.idA2A2

    AND A2.idA3A5 = A0.idA2A2

    AND A2.idA3B5 = A1.idA2A2

    AND A0.LATESTITERATIONINFO = 1

ORDER BY

    A0B.WTDocumentNumber,

    A0.VERSIONSORTIDA2VERSIONINFO;

Translate