pears.psHealthUniqueUsername

Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace.

CREATE FUNCTION "pears"."psHealthUniqueUsername"( 
  IN "StartName" CHAR(100) ) 
RETURNS CHAR(100)
BEGIN
  DECLARE "UName" CHAR(100);
  DECLARE "Inc" INTEGER;
  SET "UName" = "StartName";
  SET "Inc" = 0;
  while EXISTS(SELECT * FROM "psHealthPerson" WHERE "username" = "UName") loop
    SET "Inc" = "Inc"+1;
    SET "UName" = "string"("StartName",' ',"Inc")
  END loop;
  RETURN "UName"
END
  • database/functions/pears_pshealthuniqueusername.txt
  • Last modified: 2026/08/07 19:24
  • by 127.0.0.1