Hello everybody, I'm trying to retrive some global enumerated value of WTDocument from the Windchill 11.0 M030 database with a SQL query.
I used the queries of https://www.ptc.com/en/support/article/CS174022
but what i can get are just the Internal values of the attributes, not the Display values.
(column NAME of [LWCEnumerationEntry])
Which table contains the DISPLAY Value of the enumerated attributes?
How these attributes values are linked to the objects (eg WTDocument) ?
I can see the stringValue linked to the object, but again it contains the internal value and I need instead the display value.
Can you point me to a datamodel documentation that covers this topic?
Please take a look into the LWCLocalizablePropertyValue table. here are the display values (with column for local)
Thank you! now I'm able to see the display value in the database, LWCLocalizablePropertyValue.value
and link it to the others tables
I still miss how these values are linked to an object;
for example on WTDocument normal strings vaues are linked :
WTDocument <--(IDA3A4) stringValue (IDA3A6) --> stringDefinition
How is the join in this case?
This article should help you to link the required tables :
Hope this will help.
Another hint :
You can log SQL statements to see the query executed from Windchill to Database by using advices in this article :
or, maybe better , add wt.pom.sql using the steps in Windchill GUI :
This will show you how Windchill is building queries for any operations. Lot of lines 🙂
Thank you for interesting readings! I made some tests with this info but I still not completed my query.
Unfortunately this article query's is extracting the TYPE from the WTPart, and there is a dedicated column to link the tables WTTypeDefinition and WTPart
wttd.idA2A2 = d.idA2typeDefinitionReference
What I'm looking for now is: How a global enumerated CUSTOM value is linked to the Object (Let's say WTDocument) ?
I'm not able to connect a WTDocuemnt to it's enumerated value (LWCEnumEntry or LWCEnumEntryLink)
I guess I am missing some middle table that works like WTDocument <--stringValue--> stringDefinition
Thank you for helping
Now, please check that one, and from the queryBuilder, preview the SQL generated to get a stringValue given a document instance :
SELECT A0B.name,A4.value,A4.value2 FROM WTDocument A0,WTDocumentMaster A0B,StringDefinition A1,StringValue A2,LWCIBAAttDefinition A3,StringValue A4 WHERE (A0.idA3masterReference=A0B.idA2A2) AND (((A4.idA3A6(+) = ?) AND (A4.idA3A4(+) = A0.idA2A2))) AND ((A2.idA3A6 = A1.idA2A2) AND (A2.idA3A4 = A0.idA2A2) AND (A3.idA3A7 = A1.idA2A2))
All this issue comes directly from a disalignment between query builder result and database result:
With query builder Windchill is able to show the display values
but then when I use the same Query i got from querybuilder,
SELECT A1.value,A1.value2,A0.classnameA2A2,A0.idA2A2 FROM (SELECT A0.idA2A2,'wt.projmgmt.admin.Project2' classnameA2A2 FROM Project2 A0 WHERE (A0.branchIdA2typeDefinitionRefe = 505056)) A0 LEFT OUTER JOIN StringValue A1 ON ((A1.idA3A6 = 503093) AND (A1.idA3A4 = A0.idA2A2))
on the database, the result is the internal value (without spaces and in CAMEL Mode)
Now from your help, I understood that display name is stored in LWCLocalizablePropertyValue table, but I still miss the link between the tables..
in database LWCLocalizablePropertyValue is linked just to the LWCMasterEnumerationEntry and to LWCPropertyDefnition,(see attachment )
seems different from your DB
I think that here you will get what's you need :
select lpv.value, lpv.FR, dm.name
from wtdocument d,
where iad.name = 'MyEnum'
and ebc.idA3B4 = iad.idA2A2
and med.idA2A2 = ebc.idA3A5
and lpv.idA3C4 = med.idA2A2
and lpv.idA3B4 = ee.idA2A2
and d.ida3masterreference = dm.ida2a2
and ee.name = sv.value2
and sv.idA3A4 = d.ida2a2;
Hoep this will help. Note that I could resolve that with the wt.pom.sql loggers.