string manipulation in SPL
Posted in 1994
A new topic for me. Any pointers?
Essentially I am:
create procedure get_strg(var1 char(18), var2 char(8), var3 char(18))
returning VARCHAR(255);
DEFINE txt_strg VARCHAR(255);
DEFINE var4 CHAR(8);
LET txt_strg='';
FOREACH
SELECT variable4
INTO var4
FROM table
WHERE variable1 = var1
AND variable2 = var2
AND variable3 = var3
ORDER BY variable4
# Los problem:
LET txt_strg = txt_strg || varaible4
end foreach;
RETURN txt_strg;
end procedure;
I cannot seem to clip. I keep getting the full 255 characters in txt_strg
which makes appending the second variable moot. I've considered writing a
sub procedure, but if it always returns 255 characters, whats the point. I
also don't seem to be able to subscript. TFM is of course a great help.
j.
_____________________________________________________________________________
Jack Parker |
Hewlett Packard, BSMC Boise, Idaho, USA| He who talks most, talks least.
jparker@hpbs3645.boi.hp.com |
_____________________________________________________________________________
Any opinions expressed herein are my own and not those of my employers.
_____________________________________________________________________________