Re: Incompatible Data Type?
Rich Shepard <[email protected]>
| Newsgroups | gmane.comp.python.db.pysqlite.user |
|---|---|
| Message-ID | <[email protected]> |
On Tue, 26 Dec 2006, Adrian Klaver wrote:
> My guess is you are not picking up the correct variable.
Adrian,
I've looked closely at that today, and I don't think that's it. But, based
on your comments, I replaced the 'self.va' with the number 0.18000000. The
records are then added to the database.
Now, immediately before the SQL statement (I've gone back to the
full-blown one, not the truncated testing version), I have the statement,
'print self.va.'
Run 1: I did not change the widget from the default of 0.20, and the above
print statement showed the value in unicode; that is,
u0.20000000
Run 2: I changed the value in the widget using the bound method
def OnAlphaCut(self, event):
self.va = self.valphaVal.GetValue()
print "In OnAlphaCut: ", self.va, '\n'
and that print statement produced:
In OnAlphaCut: 0.19000000
In OnAlphaCut: 0.18000000
In OnAlphaCut: 0.17000000
so self.va is being changed in the widget. The pre-SQL print statement now
prints
0.17000000
without the prepended 'u'.
This is the same testing I did earlier today to ensure that it was the
proper variable that was to be used in the insert statement. But, as soon as
I revert to the 'self.va' the error reappears. Quite frustrating. Every
other variable is correctly assigned (they're all text or integers, 'va' is
the only real in the table), so I've no idea what else might be causing that
problem. I suspect it's somehow related to the data type, but I've no idea
how.
Thanks,
Rich
--
Richard B. Shepard, Ph.D. | The Environmental Permitting
Applied Ecosystem Services, Inc.(TM) | Accelerator
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863