DELETE Statement Apparently Not Working

Rich Shepard <[email protected]>
Newsgroups gmane.comp.python.db.pysqlite.user
Message-ID <[email protected]>
   OK. I have the variables all straightened out now, but ... it's still not
working. That is, The DELETE statement supposedly is executed, the COMMIT
supposedly runs, but the row is still in the database table.

   Here's the complete function:

     def OnDel(self, event):
       dlg = wx.MessageDialog(None, "WARNING: Deleting this variable will also delete the term sets and rules. Are you sure you want to do this?",
caption="Deleting a Variable", style=wx.YES_NO|wx.ICON_EXCLAMATION)
     showme = dlg.ShowModal()
     if showme == wx.ID_YES:
       print self.vname.GetValue()
       print self.vcomp.GetValue()
       print self.vsub.GetValue()
       self.appData.cur.execute ("DELETE from Variable where name='%s' and comp_name='%s' and subcomp_name='%s'" %
(self.vname.GetValue(),self.vcomp.GetValue(),self.vsub.GetValue()))
       self.appData.con.commit()
     dlg.Destroy()

   The correct strings are printed on the virtual console, and no error
messages are displayed.

   How do I test why the execute and commit are not working as intended? Can
I step into that function using winpdb? Is my SQL syntax incorrect?

Rich

-- 
Richard B. Shepard, Ph.D.               |    The Environmental Permitting
Applied Ecosystem Services, Inc.        |         Accelerators(TM)
<http://www.appl-ecosys.com>     Voice: 503-667-4517      Fax: 503-667-8863
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.