Is there a way to set the starting value of a primary key auto-increment 
column? For example, in HSQLDB, I can do:

CREATE TABLE test (id INTEGER GENERATED BY DEFAULT AS IDENTITY(START WITH 0) 
PRIMARY KEY)

which sets the initial value to be 0, but in H2, when I do

CREATE TABLE test (id IDENTITY)

the starting value is 1, instead of 0.

I know that there are ALTER statements that I can use to set the initial value 
to 0. However, because I am patching a library (ActiveRecord-JDBC running on 
JRuby), I cannot execute another statement to set that initial value; I would 
like for a way to set it at table definition time, all within a single 
statement.

I also cannot use the HSQLDB syntax, even though it is supported by H2, because 
I need the data type to be 64-bit integer.

Peter

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "H2 
Database" 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/h2-database?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to