pears.getwordex

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

COMMENT TO PRESERVE FORMAT ON PROCEDURE "pears"."getwordex" IS 
{CREATE FUNCTION getwordex 
 
/* Application Maintained Function / Procedure - DO NOT EDIT*/
 
(IN s1 long VARCHAR,IN ln1 SMALLINT,IN sep CHAR(10)) 
RETURNS CHAR(200)
BEGIN
  DECLARE i SMALLINT;
  DECLARE ln SMALLINT;
  DECLARE s CHAR(200);
  SET ln=ln1;
  SET s=s1;
  loop1: loop 
    SET ln=ln-1;
    IF ln <= 0 THEN
      leave loop1
    END IF; 
    SET i=charindex(sep,s); 
    IF i > 0 THEN
      SET s=stuff(s,1,i,'') 
    ELSE 
      SET s='' 
    END IF 
  END loop loop1;
  SET i=charindex(sep,s);
  IF i > 0 THEN
    SET s="left"(s,i-1)
  END IF;
  RETURN(s)
END
}
  • database/procedures/pears_getwordex.txt
  • Last modified: 2026/08/07 19:24
  • by 127.0.0.1