Fixed logic in vefn_GetROTokens to find RO Tokens for testing.
This commit is contained in:
parent
6ae55e3780
commit
500c5d224c
@ -7166,26 +7166,45 @@ AS
|
||||
BEGIN
|
||||
DECLARE @index int
|
||||
SET @index = -1
|
||||
DECLARE @indexb int
|
||||
DECLARE @indexc int
|
||||
DECLARE @indexd int
|
||||
DECLARE @indexNext int
|
||||
DECLARE @indexReturn int
|
||||
WHILE (LEN(@text) > 0)
|
||||
BEGIN
|
||||
SET @index = PATINDEX('%<[A-Z]-%' , @text)
|
||||
IF @index = 0
|
||||
SET @index = PATINDEX('%<[A-Z][A-Z0-9]-%' , @text)
|
||||
IF @index = 0
|
||||
SET @index = PATINDEX('%<[A-Z][A-Z][A-Z0-9]-%' , @text)
|
||||
IF @index = 0
|
||||
SET @index = PATINDEX('%<[A-Z][A-Z][A-Z][A-Z0-9]-%' , @text)
|
||||
SET @indexb = PATINDEX('%<[A-Z][A-Z0-9]-%' , @text)
|
||||
if((@index=0 and @indexb>0) or (@indexb > 0 and @index > @indexb))
|
||||
SET @index = @indexb
|
||||
SET @indexc = PATINDEX('%<[A-Z][A-Z][A-Z0-9]-%' , @text)
|
||||
if((@index=0 and @indexc>0) or (@indexc > 0 and @index > @indexc))
|
||||
SET @index = @indexc
|
||||
SET @indexd = PATINDEX('%<[A-Z][A-Z][A-Z][A-Z0-9]-%' , @text)
|
||||
if((@index=0 and @indexd>0) or (@indexd > 0 and @index > @indexd))
|
||||
SET @index = @indexd
|
||||
IF @index = 0
|
||||
BREAK
|
||||
SET @indexNext = @index + CHARINDEX('<' , substring(@text,@index+1,len(@text)))
|
||||
IF @IndexNext=@index
|
||||
SET @IndexNext = len(@text)+ 3
|
||||
SET @indexReturn = @index + CHARINDEX(char(13) , substring(@text,@index+1,len(@text)))
|
||||
IF @IndexReturn=@index
|
||||
SET @IndexReturn = len(@text)+3
|
||||
DECLARE @index2 int
|
||||
SET @index2 = @index + CHARINDEX('>' , substring(@text,@index,len(@text)))
|
||||
if @index2 = 0
|
||||
if @index2 = @index
|
||||
BREAK
|
||||
INSERT INTO @Tokens VALUES (substring(@text, @index,@index2-@index))
|
||||
if(len(@text) > @index2)
|
||||
SET @text = RIGHT(@text, (LEN(@text) - @index2))
|
||||
else
|
||||
SET @Text = ''
|
||||
if(@index2 > @indexNext or @index2 > @indexReturn)
|
||||
SET @text = RIGHT(@text, (LEN(@text) - @index))
|
||||
else
|
||||
BEGIN
|
||||
INSERT INTO @Tokens VALUES (substring(@text, @index,@index2-@index))
|
||||
if(len(@text) > @index2)
|
||||
SET @text = RIGHT(@text, (LEN(@text) - @index2))
|
||||
else
|
||||
SET @Text = ''
|
||||
END
|
||||
END
|
||||
RETURN
|
||||
END
|
||||
|
Loading…
x
Reference in New Issue
Block a user