On Oct 1, 2008, at 10:03 AM, Gaetan de Menten wrote:

>
> On Mon, Sep 29, 2008 at 4:46 PM, Itamar Ravid  
> <[EMAIL PROTECTED]> wrote:
>> Thanks for the answer, Mike. I was used to Oracle's behavior while  
>> writing
>> raw SQL, in which the case of unquoted column identifiers doesn't  
>> matter.
>> This behavior seems reasonable enough, although the inconsistency  
>> between
>> the cursor description and SQLA's column identifiers could throw  
>> some people
>> off.
>>
>> This causes the versioned plugin from Elixir.ext to fail on Oracle,  
>> so I'll
>> submit a patch against it to lowercase column names in  
>> table.insert()'s.
>> Thanks again.
>
> I can't accept this patch as it breaks for people using non-lowercase
> column names on non-Oracle database.
> See http://elixir.ematia.de/trac/ticket/73
>
> Some comments:
> - it fails silently: Mike, is it expected that when you do:
> connection.execute(table.insert(), {"inexistant_field": somevalue}),
> it doesn't complain in any way?

I think that is the current behavior, but it is not ideal.  It's  
likely that validating the incoming dict would add palpable overhead  
to SQL execution, but I haven't analyzed deeply.

>
> - I really think this should be fixed at SA-level (probably in the
> reflection code), as we don't do anything fancy in there...
>
> Here is roughly what happens:
>
> my_table = Table("my_table", metadata, autoload=True)
> my_table2 = Table("my_table2", metadata, *[col.copy() for col in  
> my_table.c])
> metadata.create_all()

im not sure about this one, oracle reflection definitely works.

> values = my_table.select().execute().fetchone()
> connection.execute(my_table2.insert(), values)

still somewhat controversial for the reasons I mentioned earlier,  
perhaps oracle's _normalize_name() should be applied to  
cursor.description.



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to