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

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

Query to get all the available object types within a selected context in Windchill

aachanta
15-Moonstone

Query to get all the available object types within a selected context in Windchill

Hi All,

 

I just need to write a query to get all the available object types within a selected context.

 

Can you please let me know how to query the same and to which tables in Windchill should I be viewing to write that query ?

 

Can anyone please let me know about it ?

 

Thanks and Regards,

Aditya

ACCEPTED SOLUTION

Accepted Solutions
abhishekarya
14-Alexandrite
(To:aachanta)

1. You won't be able to write a direct SQL query to retrieve all the Object Types unless you write select * and do a union of all tables.

2. I would highly recommend a Java Program as follows, You can pass the Container Name as an argument in the method, You can create a little utility which can output an excel report based on the Container you provide on the command line, Let me know if you need more help with that.

QuerySpec qs = new QuerySpec(WTContained.class);
QueryResult allContained=PersistenceHelper.manager.find((StatementSpec)qs);

while(allContained.hasMoreElements())
{
WTContained obj=(WTContained) allContained.nextElement();

//logger.debug("-Business Object is instance of WTContained -");

WTContainer container = obj.getContainer();
}

View solution in original post

3 REPLIES 3
aachanta
15-Moonstone
(To:aachanta)

Hi All, Kindly let me know any leads or inputs on the same. Thanks and Regards, Aditya
abhishekarya
14-Alexandrite
(To:aachanta)

1. You won't be able to write a direct SQL query to retrieve all the Object Types unless you write select * and do a union of all tables.

2. I would highly recommend a Java Program as follows, You can pass the Container Name as an argument in the method, You can create a little utility which can output an excel report based on the Container you provide on the command line, Let me know if you need more help with that.

QuerySpec qs = new QuerySpec(WTContained.class);
QueryResult allContained=PersistenceHelper.manager.find((StatementSpec)qs);

while(allContained.hasMoreElements())
{
WTContained obj=(WTContained) allContained.nextElement();

//logger.debug("-Business Object is instance of WTContained -");

WTContainer container = obj.getContainer();
}

Thank you Aarya.
Announcements

Top Tags