Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Concatenate Return/LineFeed Characters in String

67 views
Skip to first unread message

Cook, Russell L

unread,
Sep 14, 1999, 3:00:00 AM9/14/99
to

How do you concatenate a "\n" character in the middle of a string? This is
a fragment in the stored routine I'm developing. This does not work.

LET ship_addr = TRIM(addr1) || "\n" || TRIM(addr2) || "\n" ||
TRIM(city) || ", " || TRIM(state) || " " ||
TRIM(zip) || " " || TRIM(country);

Appreciate all of your help. Thanks in advance.


Russ

Gregg Walker

unread,
Sep 14, 1999, 3:00:00 AM9/14/99
to
Russell

Looking at your sample I wasn't quite sure what language you are using to
create the string.

If you are using Visual Basic then you need to use the constant vbLf or
vbNewLine (see visual basic documentation to see which is more appropriate
for you). If you are using Informix 4gl then you need to use the ascii
function.

VB: Let String = String & vbLf

4gl: Let String = String, Ascii(10)

I am not familiar with using 2 vertical bars for concatenation except in an
informix SQL statement. 4gl uses the comma for string concatenation and
visual basic using the ampersand.

I hope this helps.
Gregg Walker

Cook, Russell L <Russel...@marconi-is.com> wrote in message
news:7rlvtg$snv$1...@news.xmission.com...

Gregg Walker

unread,
Sep 14, 1999, 3:00:00 AM9/14/99
to
Russell

I apologize as I didn't see that you were trying to create stored procedure
(routine) until after I posted my previous reply. Unfortunately stored
procedures limit you to the available SQL built-in functions and any custom
routines you have written yourself (when you have the Universal Data
Option). I could not find any built-in functions that will generate a line
feed character (such as the 4gl Ascii function). You will probably want to
call informix on this one if you have support. Otherwise I would advise
building your string in another language and passing that string into you
stored procedure if that is possible.

Good luck!
Gregg Walker

0 new messages