Re: try to use bool/booleans with adapter/converter, but...

henk-jan ebbers <[email protected]>
Newsgroups gmane.comp.python.db.pysqlite.user
Message-ID <[email protected]>
Denns,

thanks for your answer.

I do not think the SQL is malformed; this SQL-code works with MySQL and
PostgreSQL.

than: you are right, this is what the error says.

I checked and tested again.

I think this is what happens:

SQLite sees the query: 'SELECT idpartner FROM partner WHERE active=True'

as True is not a keyword for SQLite, SQLite thinks is is a column-name;
which it isn't;

OK, i understand why SQLite give an error.

Now I have to make it 'work'

kind regards

Henk-jan

Dennis Lee Bieber wrote:

On Thu, 22 Mar 2007 15:09:39 +0100, henk-jan ebbers
<[email protected]> declaimed the
following in gmane.comp.python.db.pysqlite.user:

But somehow this does not work.
I get 'Operation Error: no such column: True'
It seems that my adapter/convert-functions are never executed

/Where/ do you get this exception? On the .connect(), .cursor(),
.execute(), ...?

That almost looks like what one would expect if trying to select on
a non-existent field.

from pysqlite2 import dbapi2 as db
cn = db.connect("test.db")
cr = cn.cursor()
cr.execute("""create table junk

... ( fld1 int,
... fld2 char
... )""")
<pysqlite2.dbapi2.Cursor object at 0x01172BF0>

cr.execute("insert into junk values (1, 'myself')")

<pysqlite2.dbapi2.Cursor object at 0x01172BF0>

cr.execute("select fld4 from junk")

Traceback (most recent call last):
File "<interactive input>", line 1, in ?
OperationalError: no such column: fld4

What am I doing wrong?

? Creating malformed SQL?

_______________________________________________
pysqlite mailing list
pysqlite-IAPFreCvJWPBWskQ1e/[email protected]
http://lists.initd.org/mailman/listinfo/pysqlite
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.