On Feb 13, 8:03 pm, Richard Jones <[EMAIL PROTECTED]> wrote:
> I've tried poking through the documentation and source to determine
> this, but it's still unclear to me how SQLAlchemy generates IDs for
> new rows in Oracle.
>
> There's support for sequences in the oracle backend, but there don't
> appear to be sequences created for my tables.
>

It is a two step process.
 - define the sequences in Oracle
 - indicate to SA that you want to use it for a given table

For example:
from sqlalchemy import *
meta = MetaData()

roles = Table('box_role',
    meta,
    Column('id', Integer, Sequence('seq_box_role_id'),
primary_key=True),
    Column('name', String(50), nullable=False),
    )

According to:
http://www.sqlalchemy.org/docs/04/metadata.html#metadata_defaults_sequences
the first step may not be required but if your DBA has some naming
conventions
he wants you to follow making them by hand may be a good idea.

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