case insensitive searchs

42 views
Skip to first unread message

Patton, Toby P CTR, Code 1235.2

unread,
Jan 9, 2012, 7:01:41 PM1/9/12
to teamcenter-enterp...@googlegroups.com
Hello group,

I have a large Team Center 3.2 customization running on Oracle (I know, it is old stuff). I would like to make the query by attributes case insensitive for some attributes. In the 'API Model Reference Guide' the term insensitive is listed as a MODeL keyword, but I can find no other reference to it. Any help would be most appreciated.

Thank You,
Toby Patton
"A frequent problem with communication is the assumption it has been achieved" - source unknown


N Cohen

unread,
Jan 10, 2012, 4:26:06 AM1/10/12
to teamcenter-enterp...@googlegroups.com
Hi Toby,

The way you do the search is:
within the Sql Api you ask for isUpper or isLower and the queried Attribute should be turn to Upper or Lower accordingly. This will bring you the attribute you are looking for .

Good lack,

Nissim Cohen
-----------------------
H.A.A.K Technologies Ltd.
haa...@gmail.com

2012/1/10 Patton, Toby P CTR, Code 1235.2 <toby.pa...@navy.mil>

Patton, Toby P CTR, Code 1235.2

unread,
Jan 10, 2012, 11:49:20 AM1/10/12
to teamcenter-enterp...@googlegroups.com
Hi Nissim,

Thanks for the response. Unfortunately, those calls are not available in my version (3.2)

Since our Oracle database is running on a massive Sun box I am thinking about adding a hidden attribute to the object that I will populate with the data from the actual attribute after forcing it to lower case. Then I will override the AllowQueryBuildOfAttr method to use the alternate attribute and the lower case version of the query value. There are only two attributes that I need this functionality for, so it shouldn't be an expensive query.

Thank You,
Toby Patton
"A frequent problem with communication is the assumption it has been achieved" - source unknown

Hi Toby,

Good lack,

--
You received this message because you are subscribed to the Google Groups "Teamcenter Enterprise Customization" group.
To post to this group, send email to teamcenter-enterp...@googlegroups.com.
To unsubscribe from this group, send email to teamcenter-enterprise-c...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/teamcenter-enterprise-customization?hl=en.

Neutgens, Kevin

unread,
Jan 11, 2012, 9:49:03 AM1/11/12
to teamcenter-enterp...@googlegroups.com
Toby,
One other option is to just add a picture to the attribute that forces or changes all text entered to lower (or upper) case, as it is entered. You will also need to change all existing data with the toupper oracle command, but then as data is entered on the search screen, the picture changes it to lower (or upper) before the search and you basically get the results you want. We have had our setup this way for 15 years, and it works great. We only use it on DocumentName and DocumentDescription, and the only negative is that data is stored and displayed as all upper case letters (in our case).
Hope this helps,

Kevin

Patton, Toby P CTR, Code 1235.2

unread,
Jan 11, 2012, 12:03:51 PM1/11/12
to teamcenter-enterp...@googlegroups.com
Hi Kevin,

Thanks for the suggestion. My problem is that the text has to remain in the case it was typed in. There are two string(2000) variables that need to retain their case, but have case insensitive query capabilities. Since my version of Team Center does not support case insensitive queries using standard API calls I decided to try something. I am already over-riding DoCreatePre, DoUpdatePre and DoCopyPre on my custom class for other reasons, so I just added some code to take what the user typed in and convert it to lower case then store it in an attribute that is on the object, but not the dialog. I then override AllowQueryBuildOfAttr to capture the construction of the SqlPtr for the two attributes and use oiSqlWhereLikeEQ on the hidden and lower case attribute. I did use Oracle SqlPlus to populate the existing items. There are only about 200,000 of these objects, so there is no noticeable performance hit. Initial testing seems positive.

Reply all
Reply to author
Forward
0 new messages