12 messages in com.googlegroups.sqlalchemy[sqlalchemy] Firebird can't print an ...
FromSent OnAttachments
Roger Demetrescu30 May 2007 10:57 
Roger Demetrescu30 May 2007 10:59 
Michael Bayer30 May 2007 11:11.patch
Roger Demetrescu30 May 2007 11:47 
Michael Bayer30 May 2007 13:29 
Roger Demetrescu31 May 2007 06:12 
johnbraduk31 May 2007 12:32 
Michael Bayer31 May 2007 12:46 
Roger Demetrescu31 May 2007 13:41 
johnbraduk01 Jun 2007 01:34 
Lele Gaifax01 Jun 2007 02:52.gz
johnbraduk01 Jun 2007 04:14 
Subject:[sqlalchemy] Firebird can't print an insert() statement
From:Roger Demetrescu (roge@gmail.com)
Date:05/30/2007 10:57:17 AM
List:com.googlegroups.sqlalchemy

Hi Michael,

I don't know when the following problem began, but anyway, I've tested it with rev.2672 and the problem persists....

Having this script:

================================== from sqlalchemy import *

db = create_engine("firebird://user:pass@host//database.fdb") metadata = BoundMetaData(db)

pessoa_table = Table('pessoa', metadata, Column('pes_id', Integer, primary_key=True), Column('pes_data', DateTime), Column('pes_nome', String(30)), Column('pes_sobrenome', String(30)), Column('pes_idade', Integer))

s = pessoa_table.select() u = pessoa_table.update() i = pessoa_table.insert() ==================================

...and trying to print s, u and i in the shell, it gives me:

print s

SELECT pessoa.pes_id, pessoa.pes_data, pessoa.pes_nome, pessoa.pes_sobrenome, pessoa.pes_idade FROM pessoa

print u

UPDATE pessoa SET pes_id=?, pes_data=?, pes_nome=?, pes_sobrenome=?, pes_idade=?

print i

Traceback (most recent call last): File "<pyshell#2>", line 1, in <module> print i File "d:\sqlalchemy\lib\sqlalchemy\sql.py", line 1225, in __str__ return unicode(self.compile()).encode('ascii', 'backslashreplace') File "d:\sqlalchemy\lib\sqlalchemy\sql.py", line 1221, in compile compiler.compile() File "d:\sqlalchemy\lib\sqlalchemy\sql.py", line 1032, in compile self.traverse(self.statement) File "d:\sqlalchemy\lib\sqlalchemy\sql.py", line 877, in traverse target.accept_visitor(v) File "d:\sqlalchemy\lib\sqlalchemy\sql.py", line 3082, in accept_visitor visitor.visit_insert(self) File "d:\sqlalchemy\lib\sqlalchemy\databases\firebird.py", line 324, in visit_insert if not self.parameters.has_key(c.key): AttributeError: 'NoneType' object has no attribute 'has_key'

The strange thing is that I am able to execute the insert statement:

i.execute(pes_id=777)

<sqlalchemy.engine.base.ResultProxy object at 0x016A3310>

I am also having another problem with firebird, which may be related to this problem or not... I'll send other message to describe it...

Thanks

PS: I've done the same tests with Postgresql and it run fine....