Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic SYNERGY (steve huntington)
Decrease font size
Increase font size
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
Search Topic Search Topic
Topic Tools Topic Tools
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
Answer This question was answered by Nigel Hoyland, on Friday, March 11, 2005 4:57 PM

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
 22-Oct-2004 12:40
User is offline View Users Profile Print this message


Michael Bourla

Posts: 10
Joined: 24-Jul-2003

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
Report this to a Moderator Report this to a Moderator
 22-Oct-2004 13:25
User is offline View Users Profile Print this message


Ross Morgan

Posts: 74
Joined: 15-Apr-2004

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]'
Report this to a Moderator Report this to a Moderator
 22-Oct-2004 17:21
User is offline View Users Profile Print this message


Michael Bourla

Posts: 10
Joined: 24-Jul-2003

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
Report this to a Moderator Report this to a Moderator
 25-Oct-2004 13:05
User is offline View Users Profile Print this message


Philipp Weißmann

Posts: 28
Joined: 12-Oct-2004

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...
Report this to a Moderator Report this to a Moderator
 1-Nov-2004 15:38
User is offline View Users Profile Print this message


Nigel Hoyland

Posts: 2
Joined: 21-Jan-2004

Answer 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
Report this to a Moderator Report this to a Moderator
 5-Nov-2004 13:30
User is offline View Users Profile Print this message


Michael Bourla

Posts: 10
Joined: 24-Jul-2003

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
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic SYNERGY forum.
There are currently 1 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 15:34.
There are currently 0 guests browsing this forum, which makes a total of 1 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.