After fixing the connection issue I get a syntax error when trying to connect
to a sqlite database and wonder if its python or sqlite. Error message seems
to indicate sqlite. I check the code in Komodo and don't get any syntax
errors. 


Here is the code

import sqlite3
from sluggy import slugify

conn = sqlite3.connect("c://Ujimadata//aid.sqlite")
cursor = conn.cursor()
cursor.execute("""SELECT country_cd, country_name FROM country""")
for country_cd, country_name in cursor.fetchall():
       cursor.execute("UPDATE country SET slug=%s WHERE country_cd=%s",
                       (slugify(country_name), country_cd))
       conn.commit()


Here is the error message

Traceback (most recent call last):
  File "C:\Python25\ron_scripts\newsqlite.py", line 9, in <module>
    (slugify(country_name), country_cd))
sqlite3.OperationalError: near "%": syntax error

-- 
View this message in context: 
http://www.nabble.com/sqlite-or-python-error-tp24381469p24381469.html
Sent from the SQLite mailing list archive at Nabble.com.

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to