Re: Lie Hetland book: Beginning Python..

2005-11-11 Thread Scott David Daniels
Magnus Lycka wrote: > Vittorio wrote: > Using the same symbol for both string substitutions and SQL placeholder > such as pysqlite 1 and the MySQL interface does, is not really a bright > idea in my opinion. Who thinks this is pretty? > > sql = "SELECT %s FROM %s WHERE %s = %%s" > cur.execute(sql

Re: Lie Hetland book: Beginning Python..

2005-11-09 Thread carlo
Gerhard Häring ha scritto: > The reason why pysqlite 0.x/1.x used paramstyle "pyformat", based on > Python string substitution for SQL parameters is that at the time > pysqlite was started, SQLite 2.x did not have any support for parameter > binding. So we had to "fake" it in Python, just like th

Re: Lie Hetland book: Beginning Python..

2005-11-09 Thread Jean-Paul Calderone
On Wed, 09 Nov 2005 17:57:46 +, Steve Holden <[EMAIL PROTECTED]> wrote: >Gerhard Häring wrote: >> Vittorio wrote: >> > [snip] >> >> I think about the only place I wrote a bit about the differences was in >> the pysqlite 2.0 final announcement: >> >> http://lists.initd.org/pipermail/pysqlite/200

Re: Lie Hetland book: Beginning Python..

2005-11-09 Thread Steve Holden
Gerhard Häring wrote: > Vittorio wrote: > >>[...] >>Nonetheless, I was unable to find any documentation about such a >>different behaviour between Pysqlite and Pysqlite2; from my beginner >>point of view the Pysqlite (Magnus' version) paramstyle looks a better >>and more pythonic choice and I d

Re: Lie Hetland book: Beginning Python..

2005-11-09 Thread Gerhard Häring
Vittorio wrote: > [...] > Nonetheless, I was unable to find any documentation about such a > different behaviour between Pysqlite and Pysqlite2; from my beginner > point of view the Pysqlite (Magnus' version) paramstyle looks a better > and more pythonic choice and I don't grasp the Pysqlite2 de

Re: Lie Hetland book: Beginning Python..

2005-11-09 Thread Vittorio
Magnus Lycka <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: Thank you for your message I found really illuminating. > Using the same symbol for both string substitutions and SQL placeholder > such as pysqlite 1 and the MySQL interface does, is not really a bright > idea in my opinion. Who

Re: Lie Hetland book: Beginning Python..

2005-11-08 Thread Magnus Lycka
Vittorio wrote: > Nonetheless, I was unable to find any documentation about such a > different behaviour between Pysqlite and Pysqlite2; from my beginner > point of view the Pysqlite (Magnus' version) paramstyle looks a better > and more pythonic choice and I don't grasp the Pysqlite2 developers

Re: Lie Hetland book: Beginning Python..

2005-11-08 Thread Vittorio
Steve Holden <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > No, you actually did quite a creditable piece of debugging. The DB-API > specifications allow database modules to substitute parameters into > SQL commands in a number of different ways, and they are supposed to > indicate the t

Re: Lie Hetland book: Beginning Python..

2005-11-07 Thread Steve Holden
Vittorio wrote: > I am reading "Beginning Python from Novice to Professional" and the book > is really awesome. Nonetheless on ch 13 "Database Support" I found this > code to import data (in a txt file) into a SQLite Database: > > #this was corrected because original "import sqlite" does not wor

Lie Hetland book: Beginning Python..

2005-11-07 Thread Vittorio
I am reading "Beginning Python from Novice to Professional" and the book is really awesome. Nonetheless on ch 13 "Database Support" I found this code to import data (in a txt file) into a SQLite Database: #this was corrected because original "import sqlite" does not work from pysqlite2 import db