Re: [pysqlite] PySqlite DELETE problem.....
Adrian Klaver <[email protected]> Tue, 30 Dec 2008 09:21:02 -0800
| Newsgroups | gmane.comp.python.db.pysqlite.user |
|---|---|
| Message-ID | <[email protected]> |
On Tuesday 30 December 2008 9:04:20 am Peter Schmidt wrote: > Hi guys. > > Have been struggling the best part of this Sunday trying to delete a > record from a table - embarassing !. Executing the exact same SQL > statement from the shell works fine ! > > I guess I have gone blind on my error - will be really grateful for a > quick review by a more competent person. > > Here is the code : > > #!/usr/bin/python > > import sqlite3 as lite > > LP = "/home/psm/Documents/It/Project/" > > con = lite.connect(LP +'psm.db') > cur = con.cursor() > statement = "DELETE from 'User' WHERE 'Id' = 'di'" > cur.execute(statement) > con.commit con.commit() > cur.close() > con.close() > > The table "User" rests in a db named "psm.db" > > The structure of table "User" in "psm.db" is : > > Id : text > Name : text > pw : text > Type : text > > Thanks in advance ! > > :-) Peter -- Adrian Klaver [email protected]