[Chicago] auto incrementing - what options do we have?
MDiPierro at cs.depaul.edu
Fri Oct 10 18:11:30 CEST 2008
A quick and dirty trick would be to have a normal auto-increment field and, after insert, compute "case" and update the insert.
where f is your function.
From: chicago-bounces+mdipierro=cs.depaul.edu at python.org [chicago-bounces+mdipierro=cs.depaul.edu at python.org] On Behalf Of Lukasz Szybalski [szybalski at gmail.com]
Sent: Friday, October 10, 2008 10:18 AM
To: The Chicago Python Users Group
Subject: Re: [Chicago] auto incrementing - what options do we have?
On Fri, Oct 10, 2008 at 8:58 AM, John-Stockton Irick <irick at uchicago.edu> wrote:
> I'm going to assume that you're talking about mysql.
> >From mysql.org
> To start with an AUTO_INCREMENT value other than 1, you can set that
> value with CREATE TABLE or ALTER TABLE, like this:
> mysql> ALTER TABLE tbl AUTO_INCREMENT = 100;
> Hope that helps.
Problem with that is that I want to have more control on case#. So if
this case is from A source the auto increment starts at case# 3000 and
if its from source B auto increment starts with case# 4000.
Chicago mailing list
Chicago at python.org
More information about the Chicago