RE: concatenation question
Posted in 2000
Topics: Stored Procedures & SPL
Assuming this is a char variable, do let str_var = trim(str_var) || "*"; The other way, str_var is blank padded to its full length, the "*" added to the end of that, which is of course longer than the variable > -----Original Message----- > From: Ben Cartwright [SMTP:ben_informix@yahoo.com] > Sent: Wednesday, August 30, 2000 2:28 PM > To: informix-list@iiug.org > Subject: concatenation question > > I am writing a stored procedure and I am trying to add > an '*' to the end of a string variable and then return > the variable. as in: > > let str_var = str_var || '*'; > return str_var; > > I have tried this a number of different ways with no > luck, the original variable is return without the '*'. > > Thanks, > > Ben > > __________________________________________________ > Do You Yahoo!? > Yahoo! Mail - Free email you can access from anywhere! > http://mail.yahoo.com/
Hi! Once we have a similar problem. Maybe the declaration str_var has a few space reserved. Although, in our case, the problem was that we declared the variable like CHAR, and Informix fill the rest of the string with blanks and not see the add. We declared the variable like VARCHAR(number of spaces) and the problem disapeared. The rest, I think is the same that Alan wrote. Bye.