carriage returns in fixed-length records [message #39001] |
Wed, 05 June 2002 13:28 |
Bill Trowsdale
Messages: 9 Registered: April 2002
|
Junior Member |
|
|
Hi - I'm trying to create fixed-length records. I know
most of the things I need to know except for one.
this statement should be 295 characters long:
select RPAD(LAST_ACTION_BY,40)||RPAD(COMMENTS,255)
from .....
However, in our system, users can enter carriage
returns in the COMMENTS field. When they do, a piece
of the comment goes to another line in my fixed-length
file.
Any idea how to get around this?
Thanks,
Bill
|
|
|
Re: carriage returns in fixed-length records [message #39002 is a reply to message #39001] |
Wed, 05 June 2002 14:13 |
Todd Barry
Messages: 4819 Registered: August 2001
|
Senior Member |
|
|
You can REPLACE the carriage returns with NULL (eliminating them). Just use whatever combination is appropriate for your carriage return (chr(10), chr(13), or chr(13)||chr(10)).
select RPAD(LAST_ACTION_BY,40)||RPAD(replace(COMMENTS, chr(10)),255)
|
|
|