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

Use of LOWER Operator in wt.query.SearchCondition

$
0
0

I am new to QuerySpec and SearchCondition.  I have an SQL query that uses the LOWER() operator.  Is it possible to use that operator in the wt.query.SearchCondition?

 

I have an array of usernames, but they are all in lowercase.  I wish to query the database with the usernames, but in the database, they are stored as mixed case.  Thus sometimes I don't get a result.

 

 

SQL:

select name,email from wtuser where lower(name) in ('ben.perry','otheruser1','otheruser2')

 

Results:

ben.perry ben.perry@company.com

otherUSER1 <email>

OtherUser2 <email>

 

 

wt.query.SearchCondition:

(this is a portion of the code in a FOR loop):

wt.query.SearchCondition(wt.org.WTUser.class,wt.org.WTUser.NAME,wt.query.SearchCondition.LIKE,userArray[z])

 

Results:

ben.perry ben.perry@company.com

<the other users aren't found because userArray[] contains only lowercase characters>


Viewing all articles
Browse latest Browse all 3592

Trending Articles



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