Incompatible Data Type?
Rich Shepard <[email protected]>
| Newsgroups | gmane.comp.python.db.pysqlite.user |
|---|---|
| Message-ID | <[email protected]> |
I finally isolated a problem that occurs when I try to add a new record to
a table. Here's the embedded SQL:
self.appData.cur.execute("insert into variable(var_name, var_alpha_cut)
values(?,?)", (self.vn, self.va))
and here's what python/pysqlite2 reports:
Traceback (most recent call last):
File "/data1/eikos/variablePage.py", line 367, in OnVarSave
self.appData.cur.execute("insert into variable(var_name, var_alpha_cut)
values(?,?)", (self.vn, self.va))
pysqlite2.dbapi2.InterfaceError: Error binding parameter 1 - probably
unsupported type
Parameter 1 is self.va. That's a real (e.g., a print statement prior to
the SQL produces 0.18000000000000000000). The table schema defines the
column, 'var_alpha_cut,' to be REAL. Therefore, I don't understand why there
is a binding problem. Unless the wxPython widget type has too many zeros
while the pysqlite REAL type is 8 bytes in size. I would have thought that
the trailing zeros would be snipped off.
What am I missing?
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