On Nov 25, 2010, at 4:30 AM, Tony Moutaux wrote:

> Hi there !
> 
> I'm a newby du SA and try to make it work with our production
> platform, using Sybase and old and scarry database schema, with table
> names like Prestation , with 1 upper case.
> 
> Sybase does not allow (to my knowledge) tu use something like
> select "Prestation".id
> 
> So I try to figure how to avoid the quoting of the tablename. I know,
> I read that if tablename is not lower case, it's quoted. But I can't
> afford it.
> 
> I'm drilling into SA to find where the quoting is done (looking in
> schema.py at the moment). But if somebody can point me to a prettier
> solution than adding my piece of crap code for this case, it would be
> great !

I did a little googling and Sybase can handle the quotes, if you set "set 
quoted_identifier on" on your database.  
(http://manuals.sybase.com/onlinebooks/group-as/asg1250e/sqlug/@ebt-link;pt=18948?target=%25N%14_1347_START_RESTART_N%25)

Normally you'd use the name "prestation" in your code, as on every other DB 
I've used, no quoting means the name is case insensitive in any case, so the 
casing doesn't matter - but the Sybase docs here are not clear on that and some 
other googling suggests this might not be the case on Sybase.

Which leaves us at the only answer you'll likely care about, just set 
quote=False on your Table object.   Good luck !




-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" 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/sqlalchemy?hl=en.

Reply via email to