I am working up a useable search function to find parishioners.
This is how I got around the plethora of names in a Roman Catholic Parish
that dates back to 1896. Each of the input name spaces allows 30 characters.

There are many unusual spellings here. The coal miners came from virtually
every European country, and names are spelled every which way, so I used
the very useful function supplied by R:Base, the SOUNDEX "SOUNDS"
Here is my solution to the problem. It works very quickly. I started by using
"OR" but it was very slow.

My favourite spelling of them all is "Jorjia" - I don't think I could find it any other way.

*****************************************************************
SET ERROR MESSAGE 677 OFF
  DROP VIEW vwParishioners1
  DROP VIEW vwParishioners
  SET ERROR MESSAGE ON
-- ContactLookupName is computed to concatenate all four names with the
-- nickname in parentheses. Nickname is also useful as "usual name"
-- My wife's lookupname is BERRY Marie Marguerite Claire (Claire)
  CREATE VIEW vwParishioners1 +
      (ContactID,ParishID,ContactSurName,ContactName1, ContactName2,+
      ContactNickName, ContactLookupName,ParishName) AS +
SELECT ContactID,OrganizationID,ContactSurName,ContactName1, ContactName2,+
ContactNickName,ContactLookupName,OrganizationName +
      FROM ContactOrganization t1, Contact t2,Organization t3 WHERE +
t1.ContactID = t2.ContactID AND t1.OrganizationID = t3.OrganizationID
  COMMENT ON VIEW vwParishioners1 is "
  CREATE VIEW vwParishioners  +
      (ContactID,ParishID,ContactSurName,ContactName1, ContactName2,+
      ContactNickName, ContactLookupName,ParishName) AS +
    SELECT * FROM vwParishioners1 +
      WHERE ContactSurName SOUNDS "BERRY" +
      UNION SELECT * FROM vwParishioners1 +
          WHERE ContactName1 SOUNDS "BERRY" +
          UNION SELECT * FROM vwParishioners1 +
              WHERE ContactName2 SOUNDS "BERRY" +
              UNION SELECT * FROM vwParishioners1 +
                  WHERE ContactNickName SOUNDS "BERRY"
  RETURN

************************************************************************

--
You received this message because you are subscribed to the Google Groups 
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rbase-l+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to