![]() |
Telelogic SYNERGY (steve huntington) | ![]() |
Topic Title: Case-insensitive queries?? Topic Summary: Ability to do case-insensitive queries Created On: 22-Oct-2004 12:40 Status: Read Only |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() Answer: Hiya Michael, You could use Perl (or whatever language) to take the string you are searching for and do a case-insensitive match on all problems (if you could narrow down your query criteria then this will speed up your query no end - otherwise it's going to take a long time!) ... ----------------------------- print "\n--> What email address are you searching for?: "; chomp ($EmailAddress = # Query for all problems (obviously you have to do your ccm_start within this script or at least ensure # you are talking to the correct session if started outside of the script). Make your query a bit more # specific if possible! @ProblemList=`ccm query "cvtype='problem'" -f "%problem_number %requester_email"`; foreach $ProblemList (@ProblemList) { if ($ProblemList =~ /$EmailAddress/i) { Do this .... print this .... } } ------------------------------- The /i switch on the pattern match should do what you want it to do. I guess if you wrote this script properly you could then do a perl2exe on it and ship it out to the users to use (this should be fairly easy to roll out and use). I am unsure why you wish to obtain this information, but surely you have an attribute (%enterer/%submitter/%owner, etc) that automatically records who raised the CR? Obviously, if CRs are raised on behalf of other people, this may give incorrect information if that is the case!? Can't think how to do this within the tool although something is niggling in the back of my mind...something about an "IGNORE_CASE" setting somewhere. If I remember, I'll let you know. Cheers, Nige | |
![]() |
|
Anyone know how to do case-insenstive queries in CM Synergy?
My problem is this: in Change Synergy I need to query on a CR string attribute (it's an email address). That's easy - (cvtype='problem') and (requester_email='fred.smith@mycompany.com') Problem is, that field is entered by the user and may be lower-case, upper-case or any mixture. Change Synergy just passes the query to CM Synergy, where "=" or "match" conditions are always case-sensitive. I need some way of querying in a case-insensitive way, so that (for example) all of these would be retrieved: - Fred.Smith@MyCompany.com - fred.smith@mycompany.com - FRED.SMITH@MYCOMPANY.COM Help gratefully received! Thanks Michael British Sky Broadcasting |
|
![]() |
|
![]() |
|
try pattern matching...
requester_email match '[fF][rR][eE][dD]\.[sS][mM][iI][tT][hH]@[mM][yY][cC][oO][mM][pP][aA][nN][yY]\.[cC][oO][mM]' |
|
![]() |
|
![]() |
|
Thanks for the suggestion, Ross. Tried it... doesn't look like pattern matching works, as Change Synergy says
No matches were found. Possible causes include: Nothing matched the query criteria. The query limit was exceeded. The original report is no longer installed. An invalid query string was supplied: '(cvtype='problem') and (requester_email match '[mM]ichael.bourla@bskyb.com')'. whereas using 'michael.bourla@bskyb.com' or 'Michael.bourla@bskyb.com' do return results (different ones of course). Are you sure pattern matching is meant to work in Synergy? Actually, I'm creating this query for users to use/personalise and so even if it worked it'd be a bit tortuous for users to have to enter all that in their queries. Although if it was the only way, then it'd have to do. Michael |
|
![]() |
|
![]() |
|
A bit brute-force: If you have only few objects that could match your query, just compare them outside Synergy/CM. I don't know how many objects you are querying through though...
|
|
![]() |
|
![]() |
|
Hiya Michael,
You could use Perl (or whatever language) to take the string you are searching for and do a case-insensitive match on all problems (if you could narrow down your query criteria then this will speed up your query no end - otherwise it's going to take a long time!) ... ----------------------------- print "\n--> What email address are you searching for?: "; chomp ($EmailAddress = # Query for all problems (obviously you have to do your ccm_start within this script or at least ensure # you are talking to the correct session if started outside of the script). Make your query a bit more # specific if possible! @ProblemList=`ccm query "cvtype='problem'" -f "%problem_number %requester_email"`; foreach $ProblemList (@ProblemList) { if ($ProblemList =~ /$EmailAddress/i) { Do this .... print this .... } } ------------------------------- The /i switch on the pattern match should do what you want it to do. I guess if you wrote this script properly you could then do a perl2exe on it and ship it out to the users to use (this should be fairly easy to roll out and use). I am unsure why you wish to obtain this information, but surely you have an attribute (%enterer/%submitter/%owner, etc) that automatically records who raised the CR? Obviously, if CRs are raised on behalf of other people, this may give incorrect information if that is the case!? Can't think how to do this within the tool although something is niggling in the back of my mind...something about an "IGNORE_CASE" setting somewhere. If I remember, I'll let you know. Cheers, Nige |
|
![]() |
|
![]() |
|
Thanks for this, Nige.
The problem is that it's actually a query through Change Synergy, not directly in CM Synergy. I mentioned CM Synergy because to run a query CS just passes it directly to CM to execute. On each CR we record the person who originally requested the change, separate from the id of the person who keyed it in. The requester may be anyone in the company, not just a user of Synergy. That requester's name may be picked from a list, in which case the email address is automatically filled in, or all the details may be entered manually. We don't restrict or modify the case of what's entered, so it may be any case at all. Hence to select all CRs with a particular person as the Requester, we need to be able to do a case-insensitive query on the email address (which is field that will uniquely identify the person). Sounds like it can be done in CM Synergy (say, within a perl script as you suggest) but not within the Query screens in Change Synergy. Many thanks anyway. Regards Michael |
|
![]() |
Telelogic SYNERGY
» SYNERGY/CM
»
Case-insensitive queries??
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.