Quantcast
Channel: PTC Community : Unanswered Discussions - Windchill
Viewing all articles
Browse latest Browse all 3592

How to Query MAX SQLFunction by Query Builder?\

$
0
0

In order to query the latest WTpart 'version', etc  A,B.C...etc.

 

 

querySpec:

            QuerySpec qs1 = new QuerySpec();              qs1.setAdvancedQueryEnabled(true);             int classIndex = qs1.appendClassList( wt.part.WTPart.class, false );             SQLFunction fun=new SQLFunction(SQLFunction.MAXIMUM,new ClassAttribute( wt.part.WTPart.class , "versionInfo.identifier.versionId" ) );                qs1.appendSelect(fun, newint[] { classIndex }, false);             qs1.appendWhere(new SearchCondition( wt.part.WTPartMaster.class , "number" , "=" , "test_number" ),WTPartMasterIndex );    

 

The query result always throw exception

 

"A statement with aggregate function can not be used with access control."

 

I try to  change SQLFunction  MAXIMUM to "LENGTH", and It is work.

 

What's the hell? What can I do  resovle the query requirement?

 

 

 

 

 


Viewing all articles
Browse latest Browse all 3592

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>