Skip to main content
10-Marble
March 30, 2018
Solved

Case Sensitive Query api

  • March 30, 2018
  • 1 reply
  • 2492 views

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

Best answer by RandyJones

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

 

1 reply

20-Turquoise
March 31, 2018

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

 

10-Marble
April 2, 2018

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!