Insertion (sql) bug in Py2.4 pySQLite 2.2

D

DurumDara

Hi !

I have this code in my program. Before this I use APSW, but that
project's connection object doesn't have close method...

.... crs.execute(*'''create table files
(*f_id integer not null primary key, f_name varchar(255), f_size long,
f_attr integer, f_crtime varchar(20), f_mdtime varchar(20), f_hash long
)*''') ...
crs=connection.cursor()
crs.execute('insert into files
(f_crtime,f_mdtime,f_attr,f_id,f_hash,f_size,f_name)
values(?,?,?,?,?,?,?)',('1','1',1,1,1,1,'a')) ... *

So: I create a table in the first, and later I want to push some
elements to it. Before this example code I use special method to create
insert sql with tuple of values. But everytime it have been failed with
this message: SQL error or inaccessible database. Then I simplified the
code with hand maded SQL. And then I got same error message. The
database file removed and rebuilded with every execution.

When I tired by this error, I returned to APSW, and then I don't got
error messages.

What is the problem in this package ?
http://initd.org/pub/software/pysqlite/releases/2.2/2.2.0/pysqlite-2.2.0.win32-py2.4.exe
With Py2.3 I use pysqlite package in my CD organizer program, and then I
does not exp. same problems.

Please help me: dd
 
R

Roger Binns

DurumDara said:
I have this code in my program. Before this I use APSW, but that project's connection object doesn't have close method...

The connection object is released when there are no more
references to it, and there are no outstanding cursors.
The existence of the connection object does not hold a
database open. In fact the only thing that holds a
database open is cursors inside a transaction. And if
those exist, calling an explicit close on the connection
object would merely generate an error message that
cursors etc exist.

I recommend reading this document:

http://www.catb.org/~esr/faqs/smart-questions.html

Roger
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top