New SQLite binary option

Peter Haworth pete at lcsql.com
Tue Nov 11 21:14:18 EST 2014


By way of an update on this, the length of the data I supply to the UPDATE
statement is around 2.5 million characters.  When I read it back in again,
it's 244 characters.  Obviously there's some severe truncation going on!

Question is - is it LC or SQLite?  Everything I read on the web says that
SQLite is quite capable of storing binary data and there are example out
there of people doing exactly the same as me.

SOunds like time for a bug report.

Pete
lcSQL Software <http://www.lcsql.com>
Home of lcStackBrowser <http://www.lcsql.com/lcstackbrowser.html> and
SQLiteAdmin <http://www.lcsql.com/sqliteadmin.html>

On Tue, Nov 11, 2014 at 5:41 PM, Peter Haworth <pete at lcsql.com> wrote:

> Has anyone used the new "binary" parameter to revOpenDatabase when opening
> an sqlite database?  It's supposed to store binary data into BLOB columns
> unchanged - apparently Livecode used to store BLOB's in a proprietary
> format.
>
> Here's what I'm doing:
>
> revOpendatabase("sqlite",<path to dbfile>,"binary")
>    database is opened OK and I can access it
>
> I have a button that opens a pdf file, reads it all into a variable named
> tData, then:
>
> revExecuteSQL gDBID,<Update statement>,"*btData"
>    which, according to the result, works OK
>
> I can read the data back in again with a SELECT statement and it is
> correctly identified by my read handler as a pdf file.  I write the data to
> a temporary file with a .pdf extension then launch the file.
>
> At that point, Preview says the file is damaged or not in a format it
> recognizes.
>
> If I use Preview to open the original pdf file, it opens with no problem.
>
> To check out what's going on, I wrote the contents of the same pdf file to
> a custom property, read the custom property into a variable, wrote the
> variable into a temp file, then launched the temp file and this time
> Preview opened it with no problem.
>
> I guess that's a long winded way of saying that maybe the new sqlite
> binary mode is not working?
>
> Looking for feedback from anyone who has used the new binary mode in a
> similar way.
>
> Pete
> lcSQL Software <http://www.lcsql.com>
> Home of lcStackBrowser <http://www.lcsql.com/lcstackbrowser.html> and
> SQLiteAdmin <http://www.lcsql.com/sqliteadmin.html>
>



More information about the use-livecode mailing list