pears.HexCriterionID
Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace.
Original SQL
CREATE FUNCTION "pears"."HexCriterionID"( /* Application Maintained Function / Procedure - DO NOT EDIT*/ IN "CriterionID" BINARY(20) ) RETURNS CHAR(40) BEGIN DECLARE "rv" CHAR(40); DECLARE "i" SMALLINT; SET "rv" = ''; SET "i" = 1; while "i" <= "byte_length"("criterionid") loop SET "rv" = "rv"+"right"("inttohex"("ascii"("byte_substr"("criterionid","i",1))),2); SET "i" = "i"+1 END loop; RETURN "rv" END