473,323 Members | 1,550 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,323 software developers and data experts.

SQLite3 problems

Expand|Select|Wrap|Line Numbers
  1. db = sqlite3.connect('mydb.db')
  2. f1l = []
  3. f1l = db.execute("SELECT f1 FROM t1").fetchall()
  4. for i in range(0,len(f1l)):
  5.     xmlfile = matchf1(f1l[i])
  6.     print xmlfile
  7.     postcount = 0
  8.     for node in xmlfile.getElementsByTagName("t1"):
  9.         c1 = node.getAttribute("c1")
  10.     if c1 != 0:
  11.         for node2 in xmlfile.getElementsByTagName("t2"):
  12.             y = node2.getAttribute("t")
  13.             x = f1l[i]
  14.             db.execute("UPDATE t1 SET f2='%s' WHERE f1='%s'"%(y,x))
  15.             print y + " added to" + f1l[i]
  16. db.commit()
  17. db.close()
Ends up with:
Traceback (most recent call last):
File "D:\sumthin.py", line 28, in <module>
db.execute("UPDATE t1 SET f2='%s' WHERE f1='%s'"%(y,x))
OperationalError: near "005": syntax error

The data base got the table "t1" and the fields "f1" and "f2".
In all rows "f1" is filled and "f2" is "none".

Any suggestions?
Apr 1 '08 #1
1 1224
Never mind. I r fix.
Apr 1 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Harold Shore | last post by:
From the release notes I read that "If you're compiling the Python source yourself, note that the source tree doesn't include the SQLite code, only the wrapper module. You'll need to have the...
2
by: John Machin | last post by:
Apologies in advance if this is a bit bloggy, but I'd like to get comments on whether I've lost the plot (or, more likely, failed to acquire it) before I start reporting bugs etc. From "What's...
66
by: mensanator | last post by:
Probably just me. I've only been using Access and SQL Server for 12 years, so I'm sure my opinions don't count for anything. I was, nevertheless, looking forward to Sqlite3. And now that gmpy...
2
by: Josh | last post by:
Hi, I'm running into a problem when trying to create a view in my sqlite database in python. I think its a bug in the sqlite3 api that comes with python 2.5. This works as expected: conn =...
4
by: Simon | last post by:
I installed the source code on unix for python 2.5.1. The install went mainly okay, except for some failures regarding: _ssl, _hashlib, _curses, _curses_panel. No errors regarding sqlite3....
13
by: mark carter | last post by:
I hesitate to ask, but ... I'm using Ubuntu Feisty: * Python 2.5.1 (r251:54863, May 2 2007, 16:56:35) on linux2 * SQLite version 3.3.13 Suppose I run the following program: import sqlite3
0
by: David | last post by:
- Are there any peculiarities with using curs.executemany(...) vs. multiple How many times are you calling execute vs a single executemany? The python call overhead will add up for thousands of...
3
by: milan_sanremo | last post by:
I have sqlite installed, but when I try to import sqlite3 I receive: Python 2.5.1 (r251:54863, Nov 3 2007, 02:54:36) on sunos5 Type "help", "copyright", "credits" or "license" for more...
0
by: Ben Lee | last post by:
hi folks -- a quick python and sqlite3 performance question. i find that inserting a million rows of in-memory data into an in-memory database via a single executemany() is about 30% slower...
15
by: Kurda Yon | last post by:
Hi, I try to "build" and "install" pysqlite? After I type "python setup.py build" I get a lot of error messages? The first error is "src/ connection.h:33:21: error: sqlite3.h: No such file or...
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...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
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: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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.