var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Sybase string function is needed!!!
I need some assistance.
I have a string "First | Second | Third | Fouth | Etc "
I need to write Sybase expression that will return
a third string part ("Third") after delimeter "|".
How to implement it?
Thanks a lot in advance!!!
Character string functions are located here:
Sounds like you'd want to do a loop and use charindex to find the starting point of the third instance and the starting point of the 4th instance then use substring( mycolumn, starting point of third, ( starting point of fourth - starting point of third) as length )
Is it looks OK?
declare @InpStr varchar(255), @bp int, @ep int, @tmpStr varchar(255), @strlen int, @theword varchar(255), @cx int, @nWord int
select @InpStr = " | One | Two | Three | Four | Five | Six | "
select @tmpStr = ltrim(rtrim(" | One | Two | Three | Four | Five | Six | "))
select @nWord = 4
select @cx = 1
while (select @cx) <= @nWord
select @bp=charindex("|", @tmpStr)
select @tmpStr=substring(@tmpStr, @bp+1, @strlen - @bp + 1)
select @ep=charindex("|", @tmpStr)
select @theword=ltrim(rtrim(substring(@tmpStr, 1, @ep - 1)))
select 'TheWord = ', @theword
select @cx = @cx + 1