Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X
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
Solved! Go to Solution.
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();
}
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();
}