Re: Putting carriage returns into varchar field
Posted in 1999
Donald You would either need to use TEXT datatype (which may be a lot more work depending on your programming language and how far you are in the development process) which supports \\r\\n or \\n in the string, or you need to do a little more work when inserting the VARCHAR to the database and selecting it back from the database. What you need to do is to parse your string before it is inserted to the database, looking for [\\r]\\n and replace them with a "special" string and on the way out parse for the special string and replace with [\\r]\\n. With web apps it is easy, we need to parse only on the way in and replace with <BR>, and when displaying to the browser it automatically evaluates to a linefeed. HTH Sujit Donald Kunecke <donald.kunecke@wcom.com> on 12/15/99 10:42:26 AM Please respond to Donald Kunecke <donald.kunecke@wcom.com> To: informix-list@iiug.org cc: (bcc: Sujit Pal) Subject: Putting carriage returns into varchar field I am trying to put carriage returns into a varchar field for data that is to be sent to a report writer. The max length of the data is 255, and probably has between 1 and 8 carriage returns. If I strip the c/r's off, I can get the record in, but, I really do need the c/r's for the report writer. Any help much appreciated.