I need to have a uninterrupted number sequence in my table for
invoices. I was trying to do it like this, but I can't get it to work.
Can anyone give me a hint?
request_table = Table('request', metadata,
Column('id', Integer, primary_key=True),
Column('number', Integer, unique=True, nullable=True))
request_table.c.number.default =
default=func.coalesce(func.max(request_table.c.number), 0).op('+')(1)
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---