Rob's TIMSS Blog

My discoveries and ramblings of TIMSS/Personify.

Wednesday, March 15, 2006

Alternate Characters

In TIMSS 5 & 6, you can use special/alternate characters (i.e. á, â, ã, ä, å, or æ) in customer names. You may just copy and paste them in from other applications, or they can be entered by holding down the ALT key and entering the corresponding code found in the Alternate Characters & TIMSS document on the TIMSSCare website.

If you use a special character for a customer name, make sure you create an alias for the customer without the special character.

For example, if a name was “Káighn Company” you would create an Alias where the “á” was a normal “a”: “Kaighn Company”. This way when searching for the company, one would not have to enter the special character.

These characters can be used in product descriptions as well (at least in TIMSS 6).

So the next question is how do I find these special characters to make sure that the name has an alias? Well I created a function on my TIMSS 6 SQL Server:

CREATE FUNCTION DBO.HASALTCHAR(@SEARCH_STRING AS VARCHAR(80))
RETURNS INTEGER AS
BEGIN
DECLARE @POSITION INTEGER, @STRING VARCHAR(80), @TRUEFALSE INTEGER
SET @POSITION = 1
SET @STRING = @SEARCH_STRING
SET @TRUEFALSE=0
WHILE @POSITION <= DATALENGTH(@STRING)

BEGIN
IF (ASCII(SUBSTRING(@STRING, @POSITION, 1))>127)
BEGIN
SET @TRUEFALSE=1
END
SET @POSITION = @POSITION + 1
END
RETURN @TRUEFALSE
END

And I can use it to find names that have alternate characters:

select c.master_customer_id, c.label_name, a.search_name, a.alias_code
from customer c
left outer join cus_alias a on c.master_customer_id=a.master_customer_id
where dbo.HasAltChar(c.label_name)=1
order by c.master_customer_id


Applies to: TIMSS5 & TIMSS6

0 Comments:

Post a Comment

<< Home