taParseCommentText

I have in the past written a proc that takes a comment field and parses it for use in SOP10106, dividing the one string into four separate strings. The logic is a little more complex than you'd think. 

Today I discovered a native GP script that does the same thing, the script and how to use it are below. 

Related Articles

... and you 'll find more on the eConnect Menu

declare @iStatus int
declare
    @I_vCMMTTEXT VARCHAR(500),
    @O_COMMENT_1 VARCHAR(250) = '' ,
    @O_COMMENT_2 VARCHAR(250) = '' ,
    @O_COMMENT_3 VARCHAR(250) = '' ,
    @O_COMMENT_4 VARCHAR(250) = ''
 
declare
    @I_vCOMMENT_1 varchar(50),
    @I_vCOMMENT_2 varchar(50),
    @I_vCOMMENT_3 varchar(50),
    @I_vCOMMENT_4 varchar(50)
 
select @I_vCMMTTEXT = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum'
 
EXEC @iStatus = taParseCommentText
    @I_vCMMTTEXT = @I_vCMMTTEXT,
    @O_COMMENT_1 = @I_vCOMMENT_1 OUTPUT,
    @O_COMMENT_2 = @I_vCOMMENT_2 OUTPUT,
    @O_COMMENT_3 = @I_vCOMMENT_3 OUTPUT,
    @O_COMMENT_4 = @I_vCOMMENT_4 OUTPUT;
 
select @I_vCOMMENT_1,@I_vCOMMENT_2,@I_vCOMMENT_3,@I_vCOMMENT_4


RealWorldCode gives developers practical, real‑world solutions with clean, working code — no fluff, no theory, just answers.
Links
Home
Knowledge Areas
Sitemap
Contact
Et cetera
Privacy Policy
Terms and Conditions
Cookie Preferences