Re: DELETE Statement Apparently Not Working

Adrian Klaver <[email protected]>
Newsgroups gmane.comp.python.db.pysqlite.user
Message-ID <[email protected]>
On Tuesday 02 October 2007 8:25 pm, Rich Shepard wrote:
> On Tue, 2 Oct 2007, Adrian Klaver wrote:
> > Several questions/steps.
> > 1) The row you want to delete actually exists in the database?
> > Not finding a row to delete is not an error just a non-op.
>
> Adrian,
>
>     Yes, it does. It's the currently displayed variable, and I can select
> it (and delete it) using the sqlite3 shell.
>
> > 2) As I mentioned previously are you sure that everything about the
> > values being supplied to the where clause is the same as the values in
> > the database?
>
>    Yes. The print statements confirm that. Those strings are what are
> passed to the delete statement.
My concern is that there are spaces in the variable strings that aren't 
showing up in the print statements but are affecting the comparison to the 
values in the database.
>
> > 3) Set up a simplified test case. I usually drop into ipython and
> > hardwire an SQL statement with values I know will work.
>
>    I tested with the sqlite3 shell, but I'll try ipython in the morning.
>
> > 4) I usually find I have fewer problems if I use one of pysqlites
> > parameter styles. I prefer the named version. Ex: name=:name and
> > comp_name=:comp_name',
> > {'name':self.vname.GetValue(),'comp_name':self.vcomp.GetValue()}
>
>    I don't follow the above. Where can I read about pysqlite's parameter
> styles?

http://initd.org/pub/software/pysqlite/doc/usage-guide.html
See 1.4 Extensions and Caveats section on the Cursor class.
>
> Thanks,
>
> Rich

-- 
Adrian Klaver
[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.