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

We are happy to announce the new Windchill Customization board! Learn more.

Case Sensitive Query api

BrianKrieger
7-Bedrock

Case Sensitive Query api

Hey, gurus!

 

I feel like I have been able to look this up before....

Can a QuerySpec be case insensitive?  E.g.

 

qs = new QuerySpec(WTGroup.class);

qs.appendWhere(new SearchCondition(WTGroup.class, WTGroup.NAME, SearchCondition.LIKE, "%"+searchValue), new int[]{0});

 

Would like to find

myString

by using "string" or "String" or "STRING" for searchValue above.

 

I am so sure I've read this somewhere........

 

Looked through the manuals, will go through again.....

1 ACCEPTED SOLUTION

Accepted Solutions


@BrianKrieger wrote:

Hey, gurus!

 

I feel like I have been able to look this up before....

Can a QuerySpec be case insensitive?  E.g.

 

qs = new QuerySpec(WTGroup.class);

qs.appendWhere(new SearchCondition(WTGroup.class, WTGroup.NAME, SearchCondition.LIKE, "%"+searchValue), new int[]{0});

 

Would like to find

myString

by using "string" or "String" or "STRING" for searchValue above.

 

I am so sure I've read this somewhere........

 

Looked through the manuals, will go through again.....


Take a look at this:

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

Change your:

qs.appendWhere(new SearchCondition(WTGroup.class, WTGroup.NAME, SearchCondition.LIKE, "%"+searchValue), new int[]{0});

to this:

qs.appendWhere(new SearchCondition(WTGroup.class, WTGroup.NAME, SearchCondition.LIKE, "%"+searchValue, false), new int[]{0});

 

View solution in original post

2 REPLIES 2


@BrianKrieger wrote:

Hey, gurus!

 

I feel like I have been able to look this up before....

Can a QuerySpec be case insensitive?  E.g.

 

qs = new QuerySpec(WTGroup.class);

qs.appendWhere(new SearchCondition(WTGroup.class, WTGroup.NAME, SearchCondition.LIKE, "%"+searchValue), new int[]{0});

 

Would like to find

myString

by using "string" or "String" or "STRING" for searchValue above.

 

I am so sure I've read this somewhere........

 

Looked through the manuals, will go through again.....


Take a look at this:

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

Change your:

qs.appendWhere(new SearchCondition(WTGroup.class, WTGroup.NAME, SearchCondition.LIKE, "%"+searchValue), new int[]{0});

to this:

qs.appendWhere(new SearchCondition(WTGroup.class, WTGroup.NAME, SearchCondition.LIKE, "%"+searchValue, false), new int[]{0});

 

Sweet.  That is it!  And is what I had imagined, a simple switch.  I am positive I had read it somewhere.....I need to go find it because I do remember where I read it had some other direct query options.

 

Thanks as always, man!

Top Tags