On Oct 2, 11:44 am, "Gaetan de Menten" <[EMAIL PROTECTED]> wrote:
> 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 Mentenhttp://openhex.org
>
>  test_m2m_case.py
> 1KViewDownload

I prepared a ticket for SA trac, but before clicking 'submit' I
decided to verify everything once again... and solved the problem:

1) your test case using sqllite failed, since you used
'USER_' (uppercase) in

user = Table('USER_', meta, autoload=True)

but table was created with lowercase name 'user_'

correcting it, test case works fine

2) Oracle allows me to create table named 'case' (no matter there is a
keyword 'case')

- mapping it as
case = Table('CASE', meta, autoload=True)
works fine

- mapping it as
case = Table('case', meta, autoload=True)
doesn't work - exception
<type 'exceptions.AssertionError'>: Couldn't find any column
information for table case
occurs - since Oracle saves table names uppercased and there is not
table 'case' so

Consider that for 'user_' columnt there is no problem - I can map it
as 'user_' or 'USER_' and SA correctly makes it uppercase for
underlying queries to system tables
in both case

It seems to me that there must be some special handling of keywords in
SA.

Using a table named 'case_' instead of 'case' solves the problem.

3) As mentioned in 2) uppercase table names works fine for mapping
user = Table('USER_', meta, autoload=True)
passes ok

but using it with manytomany relations

mapper(Case, case, properties={'users': relation(User,
secondary=case2user)})

causes the exception (mentioned in my original post) for

session.query(Case).all()

The workaround is to use lowercase table names only.


Thanks for assistance
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to