Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM General » View Thread |
Messages 1 to 4 of 4 total |
Technique for setting initial counter on Autoinc column |
Thu, Nov 30 2006 10:30 AM | Permanent Link |
David Keith | Is it possible to set the initial counter value - NOT the min value - of an autoinc column
to a specific value within a CREATE TABLE sql statement? Thanks. |
Thu, Nov 30 2006 11:22 AM | Permanent Link |
"Robert" | "David Keith" <dkeith@paychex.com> wrote in message news:5E54FA9D-2F30-4491-A6E6-4E914A5AA63C@news.elevatesoft.com... > Is it possible to set the initial counter value - NOT the min value - of > an autoinc column > to a specific value > within a CREATE TABLE sql statement? > Sure CREATE TABLE IF NOT EXISTS "t2" ( "id" AUTOINC, "b" BOOLEAN, PRIMARY KEY ("id") COMPRESS NONE LOCALE CODE 0 USER MAJOR VERSION 1 LAST AUTOINC 5 ); There is a bug in DBISAM (I think it is a bug, anyway) which requires the LAST AUTOINC to be the last statement. You are setting the last value so, in the example above, the next add will have a 6 in the ID field. Robert |
Thu, Nov 30 2006 11:42 AM | Permanent Link |
David Keith | Thanks Robert. In my testing I discovered that 'bug' or whatever. But that does work in
the CREATE TABLE statement, if it's at the end as you said. Thanks again. "Robert" <ngsemail2005withoutthis@yahoo.com.ar> wrote: "David Keith" <dkeith@paychex.com> wrote in message news:5E54FA9D-2F30-4491-A6E6-4E914A5AA63C@news.elevatesoft.com... > Is it possible to set the initial counter value - NOT the min value - of > an autoinc column > to a specific value > within a CREATE TABLE sql statement? > Sure CREATE TABLE IF NOT EXISTS "t2" ( "id" AUTOINC, "b" BOOLEAN, PRIMARY KEY ("id") COMPRESS NONE LOCALE CODE 0 USER MAJOR VERSION 1 LAST AUTOINC 5 ); There is a bug in DBISAM (I think it is a bug, anyway) which requires the LAST AUTOINC to be the last statement. You are setting the last value so, in the example above, the next add will have a 6 in the ID field. Robert |
Thu, Nov 30 2006 2:29 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Robert,
<< There is a bug in DBISAM (I think it is a bug, anyway) which requires the LAST AUTOINC to be the last statement. You are setting the last value so, in the example above, the next add will have a 6 in the ID field. >> It's not a bug - clauses in SQL statements must be specified in a defined order: http://www.elevatesoft.com/dbisam4d5_create_table_statement.htm It would be like allowing this: SELECT * ORDER BY Test FROM MyTable -- Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Sunday, May 19, 2024 at 08:46 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |