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

Case Sensitive Query api

SOLVED
Level 8

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

Re: Case Sensitive Query api


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

 

2 REPLIES 2

Re: Case Sensitive Query api


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

 

Highlighted

Re: Case Sensitive Query api

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!