469,610 Members | 2,007 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,610 developers. It's quick & easy.

Insertion (sql) bug in Py2.4 pySQLite 2.2

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_nam e)
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/pysqli...in32-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

Apr 8 '06 #1
1 1161

"DurumDara" <du*******@gmail.com> wrote in message news:ma***************************************@pyt hon.org...
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
Apr 8 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Martin Maney | last post: by
4 posts views Thread by mrstephengross | last post: by
6 posts views Thread by Rob Cowie | last post: by
14 posts views Thread by Nader Emami | last post: by
4 posts views Thread by Tilman Kispersky | last post: by
reply views Thread by devrayhaan | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.