On Feb 18, 2013, at 10:42 PM, Mauricio de Abreu Antunes <mauricio.abr...@gmail.com> wrote:
> How to use Sequence with SQLAlchemy? > > Oracle does not support autoincrement, so I tried to use Sequence > (sqlalchemy.schema) like: > > id = Column(Integer, Sequence("seq_customer_id"), primary_key=True) > > but it is not working. > > If you need more info to help me tell me then i back here to post it. > > Thanks in advance. that's the usual way to use it, executing an insert() construct against that table will invoke "seq_customer_id" in order to generate a new primary key value. There's lots of other details surrounding this usage, like making sure seq_customer_id exists, and that you're using SQL expression constructs, but that's all dependent on what additional details you'd like to share. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To post to this group, send email to sqlalchemy@googlegroups.com. Visit this group at http://groups.google.com/group/sqlalchemy?hl=en. For more options, visit https://groups.google.com/groups/opt_out.