it would appear the query to read back constraint information is: SELECT ac.constraint_name, ac.constraint_type, LOWER(loc.column_name) AS local_column, LOWER(rem.table_name) AS remote_table, LOWER(rem.column_name) AS remote_column, LOWER(rem.owner) AS remote_owner FROM all_constraints%(dblink)s ac, all_cons_columns%(dblink)s loc, all_cons_columns%(dblink)s rem WHERE ac.table_name = :table_name AND ac.constraint_type IN ('R','P') AND ac.owner = :owner AND ac.owner = loc.owner AND ac.constraint_name = loc.constraint_name AND ac.r_owner = rem.owner(+) AND ac.r_constraint_name = rem.constraint_name(+) -- order multiple primary keys correctly ORDER BY ac.constraint_name, loc.position, rem.position
so...theres your lower case. On Mar 20, 2007, at 4:38 PM, vkuznet wrote: > > Hi, > I have a dump question about naming conventions for foreign keys. > > Using ORACLE as back-end all table names are in capital letters. So > Table object looks like: > Table('BRANCH',DynamicMetaData(),Column('id',OracleInteger > (),primary_key=True,nullable=False), > Column('name',OracleString(length=500),nullable=False), > Column('lastmodifiedby',OracleInteger(), > ForeignKey('person.id')), > Column('lastmodificationdate',OracleTimestamp(timezone=False), > default=PassiveDefault(<sqlalchemy.sql._TextClause object at > 0xb6b142ac>)), > Column('creationdate',OracleTimestamp(timezone=False), > default=PassiveDefault(<sqlalchemy.sql._TextClause object at > 0xb6b1430c>)), > Column('createdby',OracleInteger(),ForeignKey > ('person.id')),schema=None) > > The question is why Foreign key is in lower case, since the table > "person" name is actually in capital > Table('PERSON',DynamicMetaData()....) > > Thanks, > Valentin. > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---