Click to See Complete Forum and Search --> : How do I use new line or Tab in SQL


alexkay
March 26th, 2003, 04:16 AM
Hi, I would like to insert some text into the DB, the text should include new lines so it would be ready for extracting.
something like:
------------------
"Dear Friend,
bla bla bla.
bla bla.

yours, "
------------------
I tried using '\n' or even concatenating '||chr(10)' or '||chr(13)', but it didnt help.

Any advise will be welcomed,
Thanks
Alex

M Owen
March 26th, 2003, 07:46 AM
vbCrLf ... concat your strings together with this ...

eduardo7095
March 28th, 2003, 02:41 PM
Use both chr(10) & chr(13)

akash.kava
March 28th, 2003, 03:36 PM
Well if you put \n or \r\n or any combination, SQL stores it properly without any hassle, the only thing you need to care is at time of presenting data. If you show up your text in some html then you will need to replace \n with <br>

99% all databases stores \n and \r\n etc as it is the way you insert. MySQL has an exception here, in my sql you will have to insert data as "\n" , not char(10) like that, mysql expects data in form of "\" and followed by n , it follows pure C 's string conventions even in sql.

I hope these two comments will be use for you in some way.