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

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

SOLVED
Highlighted
Level 9

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

Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions

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

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();
}

3 REPLIES 3

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

Hi All, Kindly let me know any leads or inputs on the same. Thanks and Regards, Aditya

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

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();
}

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

Thank you Aarya.