Florian Weimer <[EMAIL PROTECTED]> writes:

> Package: python2.3-apsw
> Version: 3.3.5r1-1
> Severity: wishlist
>
> Currently, it is not possible to store arbitrary 8-bit data in the
> database, even though this is supported by SQLite3.  For example, the
> following script should print "[('\377',), ('\000A',)]"
>
> import apsw
>
> db = apsw.Connection(":memory:")
> c = db.cursor()
> c.execute("CREATE TABLE test (a BLOB)")
> c.execute("INSERT INTO test VALUES (?)", ("\377",))
> c.execute("INSERT INTO test VALUES (?)", ("\000A",))
> print list(c.execute("SELECT * FROM test"))

APSW uses the buffer class to store store binary data (see
<http://www.rogerbinns.com/apsw.html#Types>).

Try this:

import apsw

db = apsw.Connection(":memory:")
c = db.cursor()
c.execute("CREATE TABLE test (a BLOB)")
c.execute("INSERT INTO test VALUES (?)", (buffer("\377"),))
c.execute("INSERT INTO test VALUES (?)", (buffer("\000A"),))
print list(c.execute("SELECT * FROM test"))

        Regards,
        Joel

-- 
Joel Rosdahl <[EMAIL PROTECTED]>
Key BB845E97; fingerprint 9F4B D780 6EF4 5700 778D  8B22 0064 F9FF BB84 5E97


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to