Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formatting problem

Status
Not open for further replies.

FatsGordon

Programmer
Dec 29, 2003
4
AR
Hi all,

Is there a way to include an escape character (especifically the ASCII(10)) into an
stored procedure variable? I've tried ASCII(10) (in 4GL works Ok) but the parser
rejects it.

It should go this way (just as an example):

LET line_feed = ASCII(10); -- This doesn't work
..........
LET my_variable = some_things || line_feed || more_stuff || line_feed ||
just_more_stuff || line_feed; -- my_variable is a CHAR one

I need that in order to formatting the output text, which is included into a single
CHAR variable. When completed the routine, I inserted that variable into a temp table
(just one field), and then performed an UNLOAD to a text file. The ASCII(10) goes
multiple times inside the output file.

I'm using Informix 7.31.

Thank you!
 
Maybe you can insert your LF into some dummy-Database field, select it from your procedure into a variable and concatenate that with your stuff. Something like that:

DEFINE lc_lfchar char;

select linefeed
into lc_lfchar
from lfdummytable;

LET yourvar = stuff || lc_lfchar || morestuff || lc_lfchar;

Furthermore there is a -X switch to dbaccess, which makes UNLOAD export special chars in a readable form. Maybe this is of help too.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top