CREATE OR REPLACE FUNCTION kfoqsdb.alignuencnames(dpnam character varying, upnam character varying)
  RETURNS character varying
  LANGUAGE plpgsql
  AS $function$
  DECLARE i INTEGER;
  DECLARE npnam varchar;
  DECLARE nunam varchar;
  BEGIN
  npnam = dpnam;
  nunam = upnam;
  LOOP
    i = strpos(npnam,CHR(65533));
    EXIT WHEN i=0;
    npnam = overlay(npnam placing '#' from i);
    nunam = overlay(nunam placing '#' from i);
  END LOOP;
  RETURN nunam;
  END
  $function$