pears.FirstWord
Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace.
Original SQL
CREATE FUNCTION "pears"."FirstWord"( /* Application Maintained Function / Procedure - DO NOT EDIT*/ IN "sWords" CHAR(50) ) RETURNS CHAR(50) BEGIN DECLARE "i" INTEGER; SET "swords" = "trim"("swords"); SET "i" = "charindex"(' ',"swords"); IF "i" = 0 THEN RETURN "swords" ELSE RETURN("left"("swords","i"-1)) END IF END