Re: Pysqlite storing file as blob example
- From: 7stud <bbxx789_05ss@xxxxxxxxx>
- Date: Tue, 31 Jul 2007 00:13:53 -0700
On Jul 30, 6:25 pm, rustyhow...@xxxxxxxxx wrote:
I'm trying to store binary data in a sqlite database and call into the
db using pysqlite 3.
What I've got so far is this:
import sqlite
con = sqlite.connect(DB_PATH)
cur = con.cursor()
query = """create table t1(
ID INTEGER PRIMARY KEY,
data BLOB );"""
cur.execute(query)
con.commit()
b = buffer('/path/to/binary/file')
buffer() ?
From the docs:
----
There are several built-in functions that are no longer essential to
learn, know or use in modern Python programming. They have been kept
here to maintain backwards compatibility with programs written for
older versions of Python.
....
buffer(object[, offset[, size]])
----
.
- Follow-Ups:
- Re: Pysqlite storing file as blob example
- From: Carsten Haese
- Re: Pysqlite storing file as blob example
- References:
- Pysqlite storing file as blob example
- From: rustyhowell
- Pysqlite storing file as blob example
- Prev by Date: Re: Reading a two-column file into an array?
- Next by Date: Re: Directory
- Previous by thread: Re: Pysqlite storing file as blob example
- Next by thread: Re: Pysqlite storing file as blob example
- Index(es):
Relevant Pages
|