Beeno wrote: > > Hello > > Sqlalchemy appears to be aliasing each column in a SELECT statement as > a concatenation of the schema, table name and column name. The > resulting alias exceeds DB2's 30 character limit for a column. > > For example: > > If the name of the schema was 'myshemaname', the table was called > 'mytablename' and the column was appropriately named 'mycolumnname' > the resuling alias of the column would be > myschemaname_mytablename_mycolumnname and the following DB2 SQL > exception will be generated: > > sqlalchemy.exceptions.ProgrammingError: (ProgrammingError) > ibm_db_dbi::ProgrammingError: [IBM][CLI Driver][DB2/AIX64] SQL0107N > The name "myschemaname_mytablename_mycolumnname" is too long. The > maximum length is "30". SQLSTATE=4 > > Is the any workaround for this? > > Is there anyway for force Sqlalchemy to use only the colum name when > creating an alias?
this is technically a bug in the DB2 dialect as they should be setting the "max_identifier_length" attribute correctly on their dialect. You can set it manually: engine = create_engine(...) engine.dialect.max_identifier_length = 30 --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
