specify __tablename__ as an all lower case name, which indicates that it's case insensitive. It will not be quoted, provided it consists of regular alphanumeric characters. Right now it is assumed to be case sensitive which results in quotes, and results in a non-match since that's probably not how Firebird sees the name (it accepts quotes, it just indicates exactly that casing).
On Apr 18, 2013, at 7:45 PM, Holger Schramm <[email protected]> wrote: > Hi, > > i am playing around with sqlalchemy.orm and firebird server. > > engine = > create_engine('firebird+kinterbasdb://SYSDBA:masterkey@localhost/C:/path/to/database/DEMODATABASE.FDB') > db = engine.connect() > Session = scoped_session(sessionmaker(autocommit=False, autoflush=False, > bind=engine)) > session = Session() > base = declarative_base() > class UserOnline(base): > __tablename__ = 'USERONLINE' > NAME = Column('NAME', VARCHAR(60), primary_key=True) > > query = session.query(UserOnline) > result = query.all() > > this produces an error: NoSuchColumnError: "Could not locate column in row > for column 'USERONLINE.NAME'" > But the colum exists! > > Now I made an print to query, this produces: > > SELECT "USERONLINE"."NAME" AS "USERONLINE_NAME" > FROM "USERONLINE" > > I use FlameRobin (a Windows Gui Tool for connecting directly to the firebird > database, entered the query from above > and it doesn't work. After looking around it seems that the firebird database > server doesn't accept the quotes. These > quotes are from dialect #3. I read in the SQLA documentation that per default > the dialect #1 is used for connecting > to database. But why there are quotes? > > Thanks for help > > Kind regards, > Holger > > -- > You received this message because you are subscribed to the Google Groups > "sqlalchemy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/sqlalchemy?hl=en. > For more options, visit https://groups.google.com/groups/opt_out. > > -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sqlalchemy?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
