Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I am using Python SQLAlchemy cx_Oracle. And I am storing a string like this

"1 Some Road\nSome Place\nSome City"

into a db.Text field. But after saving it to it, what I get back is:

 "1 Some RoadSome PlaceSome City"

So, do you know who has eaten my "\n"s? Please help me out

Cheers

share|improve this question
 
That may be how it's represented in your client but it's not necessarily how it's stored in the database... –  Ben 17 hours ago

1 Answer

try to insert you string like this:

insert into table_name (column_name) values ('1 Some Road' || chr(10) || 'Some Place' || chr(10) || 'Some City');

chr(10) represents the char with nummer 10 from ASCII Table - the 'new line'

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.