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

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Case Sensitive Query api

BrianKrieger
10-Marble

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.....

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!

Announcements


Top Tags