473,326 Members | 2,133 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

sqlite empty inserts

Hello,
I created a table like:

create table __saved_query__ (vdb_name text , query_table_name text
PRIMARY KEY, query text)

and then I insert as follows

self.cursor.execute( "insert into __saved_query__(vdb_name,
query_table_name, query) values (?,?,?)", (vdbname,
foldername,where_query))
self.conn.commit()
Now for some reason, the first insert works, but thereafter all
inserts result in empty rows
e.g
sqliteselect * from __saved_query__;
TestVDB|test_b|title regexp 'boo'
||
||

The last two rows are from the 2nd and 3rd inserts. The values i;m
inserting are non null.

Any ideas?

Thank you for your time
Saptarshi

Aug 16 '08 #1
2 1466
sapsi wrote:
I created a table like:

create table __saved_query__ (vdb_name text , query_table_name text
PRIMARY KEY, query text)

and then I insert as follows

self.cursor.execute( "insert into __saved_query__(vdb_name,
query_table_name, query) values (?,?,?)", (vdbname,
foldername,where_query))
self.conn.commit()
Now for some reason, the first insert works, but thereafter all
inserts result in empty rows
e.g
sqliteselect * from __saved_query__;
TestVDB|test_b|title regexp 'boo'
||
||

The last two rows are from the 2nd and 3rd inserts. The values i;m
inserting are non null.

Any ideas?
Change the query to ... query_table_name text PRIMARY KEY NOT NULL ... to
verify that assertion before you look any further.

Peter
Aug 16 '08 #2
I forgot to mention that i was creating a view just before this i.e
sql="create view %s as %s" % (foldername, query)
# self.cursor.execute(sql)
self.cursor.execute(sql)

Now if i remove this, the insert code works fine.
Regards
Saptarshi

Aug 16 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: stan k. | last post by:
First of all i'm on a win32 platform using java. I also have mysql installed. My question isabout benchmarks and multiple inserts & selects SQLITE: http://www.sqlite.org/ HSQL:...
0
by: stan k. | last post by:
First of all i'm on a win32 platform using java. I also have mysql installed. My question isabout benchmarks and multiple inserts & selects SQLITE: http://www.sqlite.org/ HSQL:...
0
by: stan k. | last post by:
mysql vs sqlite vs hsql First of all i'm on a win32 platform using java. I also have mysql installed. My question isabout benchmarks and multiple inserts & selects SQLITE:...
2
by: Alexander Stuckenholz | last post by:
Hello. I´m using the ado.net provider from sourceforge for SQLite database. Till now everything works fine. But today i tried to enter some binary data into one row. Here´s my code: ...
2
by: Christian Stooker | last post by:
Part one: ====== Hi ! I want to use SQLite database like the FireBird database: with big isolation level. What's that meaning ? I have an application that periodically check some input...
12
by: John Salerno | last post by:
I've been looking around and reading, and I have a few more questions about SQLite in particular, as it relates to Python. 1. What is the current module to use for sqlite? sqlite3? or is that not...
11
by: ra294 | last post by:
I am building a page that needs to recieve some parametes and return blank page (empty response). After I recieve the parametes I write: Response.clear Response.End When I run the page I still...
0
by: smitty1e | last post by:
Disclaimer(s): the author is nobody's pythonista. This could probably be done more elegantly. The driver for the effort is to get PyMacs to work with new-style classes. This rendering stage...
8
by: Gilles Ganault | last post by:
Hello I need to compile PHP5 with SQLite statically and without PDO. I don't need DB-independence, so it's fine using sqlite_*() functions instead of PDO. 1. I've downloaded, compiled, and...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.