hi,
just ran into the following problem: When creating tables (for oracle)
with a primary key fetched from a sequence, the create statement for
the sequence is issued twice; i.e. the following code

from sqlalchemy import MetaData, create_engine, Table, Column,
Integer, Sequence
from sqlalchemy.schema import DDL

def dump(sql, *multiparams, **params):
    print sql.compile(dialect=engine.dialect)
engine = create_engine('oracle://', strategy='mock', executor=dump)

metadata = MetaData()
metadata.bind = engine

t = Table('testtable', metadata,
    Column('pk', Integer, Sequence('testtable_pk_seq',
schema='schemaname'), primary_key=True),
    schema='schemaname'
)
t.create()


will print:


CREATE SEQUENCE schemaname.testtable_pk_seq

CREATE TABLE schemaname.testtable (
        pk INTEGER NOT NULL,
        PRIMARY KEY (pk)
)


CREATE SEQUENCE schemaname.testtable_pk_seq


Is this a bug?
regards
robert

-- 
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