superfuntastic wrote:Thanks for the quick response. Ultimately I ended up editing the source data to fill Nickname with Name if it was null, but in the future I will try a different driver.
Even that you consider the issue closed, this is how I solved it.
Code: Select all
SELECT
CASE WHEN "tPerson"."GivenName" IS NULL
THEN
COALESCE ( "tPerson"."Surname", '' )
ELSE
COALESCE ( "tPerson"."Surname" || ',', '' )
END ||
CASE WHEN "tPerson"."Surname" IS NULL
THEN
COALESCE ( "tPerson"."GivenName", '' )
ELSE
COALESCE ( ' ' || "tPerson"."GivenName", '' )
END ||
COALESCE ( ' (' || "tPerson"."Nickname" || ')', '' ) ||
COALESCE ( ' ' || "tPerson"."MiddleInitial(s)", '' ) ||
COALESCE ( ' ' || "tPerson"."Suffix", '' ) ||
COALESCE ( ' (' || TO_CHAR( "tPerson"."DateOfBirth", 'MM/DD/YYYY' ) || ')', '' ) "Person",
"PersonID"
FROM
"tPerson"
ORDER BY
"Person" ASC
I come across a lot of names provided, where they use the following as a variation:
Jones, Nick
Jones, Nicholas
Jones, Axel
Mr. jones
Their registered name is actually: Jones, Nicholas Axel.
Where they all are the same person
What ever they provide the first time, I always fill out Surname, GivenName.
There MUST be an entry in GivenName, if anything is provided.
The content of the GivenName can therefore change from Axel to Nick to Nicholas, when the full information is provided.
When updated information comes to light, e.g. the GivenName is actually the NickName, I will update the info.
When is Person provides different information, I am sometimes having to check against Surname-DOB.
Sometimes that does not even work, and I end up getting a response form the database where the EmailAddress or the PhoneNumber is already recorded.
Then I have to investigate.
Sometimes it is even impossible to determine still.
Hope this helps,
Dream
LO 7.x, HSQLDB 2.7.x & Ubuntu 22.04 LTS.