Re: [pysqlite] How To Insert A Variable Number of Values

Rich Shepard <[email protected]> Sat, 31 May 2008 07:34:00 -0700 (PDT)
Newsgroups gmane.comp.python.db.pysqlite.user
Message-ID <[email protected]>
On Fri, 30 May 2008, Adrian Klaver wrote:

> There are no values supplied in the statement below:
> self.appData.cur.execute(stmt)
> Should be something along lines of self.appData.cur.execute(stmt,rowList).

Adrian,

   Hoo-boy! Yesterday was rather stressful and I did forget to append rowList
to the execute statement. Thanks for pointing out the obvious.

> This will get you past the no bindings error. For the variable length
> statement try using named paramstyle. This uses a dictionary to hold the
> bindings. See:
> http://oss.itsystementwicklung.de/download/pysqlite/doc/usage-guide.html#python-database-api-2-0-compliance

   I'll definitely look at that later today. Having fixed the missing data
portion of the execute statement I'm back to seeing: "IndexError: string
index out of range"

Thanks,

Rich

-- 
Richard B. Shepard, Ph.D.               |  Integrity            Credibility
Applied Ecosystem Services, Inc.        |            Innovation
<http://www.appl-ecosys.com>     Voice: 503-667-4517      Fax: 503-667-8863