Re: Error Explanation/Referential Integrity Question

[email protected] (Adrian Klaver)
Newsgroups gmane.comp.python.db.pysqlite.user
Message-ID <100220071934.10708.47029D4E00020EF8000029D422007374789D0A900E04050E@comcast.net>
 -------------- Original message ----------------------
From: Rich Shepard <[email protected]>
> On Tue, 2 Oct 2007, [email protected] wrote:
> 
> > Not sure, but I use wxPython using WAX and if I am looking for the value
> > of a combo box, I do something like self.vname.GetValue() which returns
> > the text in the combobox. Is that what you are looking for? Or am I
> > completely misunderstanding the problem.
> 
> Greg,
> 
>    Unfortunately, I think you mis-read my problem statement.
> 
>    Getting the value of the textCtrl portion of the combo box is accomplished
> using self.vname.GetValue().

Is this value assigned to a variable? 

> 
>    My problem is understanding the error message produced by pysqlite2 when I
> tried to programmatically delete a specific row in a table. Let me re-show
> it:
> 
> >   def OnDel(self, event):
> >     self.appData.cur.execute ("DELETE from Variable where name = '%s'" %
> > self.vname)
> >     self.appData.con.commit()

Should self.vname be self.vname.GetValue()?

> 
>    I've added a warning message box to the code above, but that changes
> nothing in the action part.
> 
>    ... and python complained
> 
> > Traceback (most recent call last):
> >   File "/data1/eikos/variablePage.py", line 547, in OnDel
> >     self.appData.cur.execute ("DELETE from Variable where name = '%s'" %
> > self.vname)
> > pysqlite2.dbapi2.OperationalError: near "wxComboBox": syntax error
> 
>    I don't know what the syntax error is, which "wxComboBox" is referenced,
> nor how "near" the error is. BTW, 'name' is the attribute of that column in
> the table.

My guess is, the wxComboBox is the one that the vname value comes from. The syntax error 
may be that the value being assigned to %s is incorrect.
> 
> 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.