Show pageOld revisionsBacklinksExport to PDFFold/unfold allBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== pears.MakeKeyName ====== <WRAP center round info> Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace. </WRAP> ===== Original SQL ===== <code sql> create function "pears"."MakeKeyName"( /* Application Maintained Function / Procedure - DO NOT EDIT*/ in "sSource" char(60) ) returns char(60) begin declare "rv" char(60); declare "isin" char(50); declare "c" char(1); set "rv" = ''; set "isin" = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ&0123456789'; set "isin" = "isin"+"char"(39); if "isnull"((select "removespacesfromkeynames" from "params"),0) = 0 then set "isin" = "isin"+' ' end if; set "ssource" = "trim"("ucase"("csconvert"("ssource",'ascii'))); while "length"("ssource") > 0 loop set "c" = "left"("ssource",1); if "charindex"("c","isin") > 0 then set "rv" = "rv"+"c" end if; set "ssource" = "stuff"("ssource",1,1,'') end loop; if "trim"("rv") = '' then set "rv" = 'UNKNOWN' end if; return("rv") end </code> database/functions/pears_makekeyname.txt Last modified: 2026/08/07 19:24by 127.0.0.1