Carriage Returns Preserved?

Hi,
If I have a multiline TextArea which contains for example 6 lines of text, and I then save this data to a database column - will the carriage returns be preserved when I reload the database column text back into the TextArea?

I need to ensure all returns are preserved - so 6 lines of text, remain 6 lines of text, and not all added together on one line.
I can’t actually test it because I only have my iPad available at the moment.

Thanks.

If you insert it as BLOB everything will be preserved exactly as it is.

Yes, the text is preserved exactly as you stored it. Just be sure to use DatabaseRecord or a PreparedSQLStatement to perform your insert.

I am creating a code snippet app as part of my learning process.

Am I correct in believing that Blob holds 65,535 bytes?
If so, does SQLite in Xojo support Medium or Long Blob, as some of the snippets may be quite large?

Thanks.

or store it in a TEXT field…I use ENCODEBASE64 to make it all ASCII… this makes it easier (for me) that dealing with BLOBS, plus it provides a low level of “encryption” (not that a 3rd grader couldn’t crack that :slight_smile: )

Both Blob and Textfield have a theortical maxsize of 1 BILLION, but most implemenation are set to max out at 2,147,483,647

[quote=90627:@Richard Summers]I am creating a code snippet app as part of my learning process.

Am I correct in believing that Blob holds 65,535 bytes?
If so, does SQLite in Xojo support Medium or Long Blob, as some of the snippets may be quite large?

Thanks.[/quote]
http://www.sqlite.org/limits.html#max_length
We haven’t changed that so about 1Gb

Thank you very much - I will try using Blob.

Having the same issue with text fields and happened upon this thread. After having backed up my database I converted the field to a blob. That seemed to go well except the issue continues. It’s a MySQL database. It’s a simple contact database with one field for notes. Prepared statements are used to create and update records.

If I put a carriage return in the field to create a new line it comes back with the “black diamond” character and the lines are strung together. If all I do is hit the update button again then it comes back with 3 of those characters. Do it again and 9 are returned. It’s all one string.

Check the encoding of the string that comes back. I’ll bet it’s set to nil so you need to use DefineEncoding.

Exactly! Thank you.