Re: Need help on stored procedure language for 5.x ver
Posted in 1995
On Dec 18, 1:11pm, praveen@qsun.ho.att.com wrote: > Subject: Need help on stored procedure language for 5.x ver > > ----- Begin Included Message ----- > > Netters, > > > I am writing a stored procedure, that has a variable > declared as str CHAR(500). I am trying to clip a another variable > to the end of str, although str has been assigned 100 char, > I was assuming by doing let str = str || xx (integer). > would concatinate starting from str[101] instead I noticed > that it concatinates at the end str[500] or something. > > the debug file shows a big blank space, and str clipped, xx > doesn't work. > > Does anybody out there have any suggestion or work around this > > Thanks in advance > Praveen Praveen, 5.x SPL didn't include a clipped function. This arrived in V7 as TRIM. You can acheive some of the same affects in 5.x using varchar's. Define str as varchar(500) and pass in an already clipped string to the stored procedure (It won't automatically clip it for you) or read a varchar from the database where it is already clipped. Then you can use || to string another item after this. Be warned though, if you string "123" || "123" varchar strings together, the result is not a clipped varchar field, the result is char with trailing spaces so only one || can be done with your varchar string. This makes it of limited use. As you cannot define a variable subscript to a char field you can't process character by character either. Chances are you will need to do most character string handling outside SPL until you upgrade to V7. Cheers - Jim -- ----------------------------------------------------------------------------- Jim Gordon DHL Airways Inc. jgordon@us.dhl.com ----------------------------------------------------------------------------- My opinions are my own. They may vary with time but they remain mine!