On Thu, Oct 2, 2008 at 10:26 AM, esvist <[EMAIL PROTECTED]> wrote:
> I changed the query statement - same result...
>
> Before posting a ticket, could you verify, this would run on any other
> database (not Oracle) correctly?
Seems like the issue is not specific to Oracle but rather a case
issue, as the attached test case fails with the same error you have.
--
Gaƫtan de Menten
http://openhex.org
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"SQLElixir" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sqlelixir?hl=en
-~----------~----~----~----~------~----~------~--~---
from sqlalchemy import *
from sqlalchemy.orm import *
db = create_engine('sqlite:///')
db.echo = True
conn = db.connect()
conn.execute("""CREATE TABLE user_ (
id INTEGER(16)
CONSTRAINT pk_user PRIMARY KEY,
name VARCHAR(32) NOT NULL
);
""")
conn.execute("""CREATE TABLE case_ (
id INTEGER(16)
CONSTRAINT pk_case PRIMARY KEY,
name VARCHAR(32) NOT NULL
);
""")
conn.execute("""CREATE TABLE case2user (
case_id INTEGER(16) NOT NULL
CONSTRAINT fk_c2u_case REFERENCES case_ (id),
user_id INTEGER(16) NOT NULL
CONSTRAINT fk_c2u_user REFERENCES user_ (id),
CONSTRAINT pk_case2user PRIMARY KEY (case_id, user_id)
)""")
conn.close()
meta = MetaData()
meta.bind = db
#works
#user = Table('user_', meta, autoload=True)
# autoload works, but fails to build join condition
user = Table('USER_', meta, autoload=True)
case = Table('case_', meta, autoload=True)
case2user = Table('case2user', meta, autoload=True)
class Case(object):
pass
class User(object):
pass
mapper(Case, case, properties={
'users': relation(User, secondary=case2user)
})
mapper(User, user)
session = sessionmaker()()
session.query(User).all()