pears.PadStr

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

CREATE FUNCTION "pears"."PadStr"( 
  /* Application Maintained Function / Procedure - DO NOT EDIT*/
  IN "TheStr" CHAR(50),IN "TargetLength" tinyint,IN "PadChar" CHAR(1) ) 
RETURNS CHAR(50)
BEGIN
  DECLARE "rv" CHAR(50);
  SET "rv" = "left"("isnull"("thestr",''),"targetlength");
  IF "isnull"("PadChar",'') = '' THEN
    SET "PadChar" = ' '
  END IF;
  while "length"("rv") < "targetlength" loop
    SET "rv" = "rv"+"padchar"
  END loop;
  RETURN "rv"
END
  • database/functions/pears_padstr.txt
  • Last modified: 2026/08/07 19:24
  • by 127.0.0.1