cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

How extract Display enumerated value of an object?

Highlighted
Participant

How extract Display enumerated value of an object?

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?

 

Thank you

7 REPLIES 7
Highlighted

Re: How extract Display enumerated value of an object?

Hi,

 

Please take a look into the LWCLocalizablePropertyValue table. here are the display values (with column for local)

 

hlafkir_0-1601024822635.png

 

good luck

Highlighted

Re: How extract Display enumerated value of an object?

Thank you! now I'm able to see the display value in the database, LWCLocalizablePropertyValue.value

and link it to the others tables

LWCLocalizablePropertyValue.IDA3B4-->LWCEnumEntry.IDA2A2

LWCEnumEntryLink.IDA3B4-->LWCEnumEntry.IDA2A2

LWCLocalizablePropertyValue.IDA3C4-->LWCMasterEnumerationDefinition.IDA2A2

 

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?

 

 

 

Tags (1)
Highlighted

Re: How extract Display enumerated value of an object?

Hi,

 

This article should help you to link the required tables :

 

https://www.ptc.com/en/support/article?n=CS302379

 

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 :

 

https://www.ptc.com/en/support/article/CS46545

 

or, maybe better , add wt.pom.sql using the steps in Windchill GUI :

 

https://www.ptc.com/en/support/article/CS145146

 

This will show you how Windchill is building queries for any operations. Lot of lines 🙂

 

 

Hicham

Highlighted

Re: How extract Display enumerated value of an object?

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

Highlighted

Re: How extract Display enumerated value of an object?

Hi Colleague,

 

 

 

 

 

 

Now, please check that one, and from the queryBuilder, preview the SQL generated to get a stringValue given a document instance :

 

https://www.ptc.com/en/support/article/CS247369

 

hlafkir_1-1602149400926.png

 

 

 

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))
[690066]

 

hicham

Hicham

Highlighted

Re: How extract Display enumerated value of an object?

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 

AP_9529218_2-1602163374667.png

 

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) 

AP_9529218_1-1602163350722.png

 

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 

 
 
 

 

Highlighted

Re: How extract Display enumerated value of an object?

I think that here you will get what's you need :

 

select lpv.value, lpv.FR, dm.name
from wtdocument d,
wtdocumentmaster dm,
LWCIBAAttDefinition iad,
LWCEnumerationBasedConstraint ebc,
LWCMasterEnumerationDefinition med,
LWCEnumerationEntry ee,
LWCLocalizablePropertyValue lpv,
stringValue sv
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 dm.name='myDocEnum'
and ee.name = sv.value2
and sv.idA3A4 = d.ida2a2;

 

hlafkir_0-1602168777632.png

 

hlafkir_1-1602168965405.pnghlafkir_2-1602169002062.png

 

Hoep this will help. Note that I could resolve that with the wt.pom.sql loggers.

 

Good luck

 

Hicham

Announcements