InstantDB Project
About InstantDB
Project Mail Lists
Short History
Reporting Bugs
Screen Shots
3rd Party Examples
FAQs

Software
Downloads
Documentation
CVS Repositories
Roadmap
License

About Enhydra.org
Who We Are
News, Articles & Events
Getting Involved
Contact Us

Community
Demos
Contributions
Resources
Case Studies
On The Edge! -NEW-
Commercial Vendors


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: InstantDB: AUTOINCREMENT


Hiya,

> I have a PK defined to autoincrement  but it seems to want to start at
1000.
> Is this default or could I have changed it somehow without knowing it?
> Can I reset this?

That's the default, you can change it if you want.
http://instantdb.enhydra.org/software/documentation/types.html

>By default, all AUTO-INCREMENT int columns start at 1,000, and all
AUTO-INCREMENT long columns start at 10,000,000,000. All values increment by
1. You can alter the base value using the command:

SET INCREMENT_BASE {<base>|MAX} ON {<table>.<column> | ALL}

For example, to set the next auto-inc value to 100 you would issue the
command "SET INCREMENT_BASE 100 ON mytable.mycolumn". Sometimes it is
necessary to tell a column that it should find its maximum value and then
allocate auto-increment values above that. This is particularly useful if a
table has been imported from an external source. An example of this would be
something like "SET INCREMENT_BASE MAX ON mytable.mycolumn". If a large
number of tables have been imported then it might be convenient to tell the
database to set all the auto-increment columns to to be one more than their
maximum values. This can be done with: "SET INCREMENT_BASE MAX ON ALL".

cherio

Hamish

-----------------------------------------------------------------------------
To unsubscribe from this mailing list, send email to majordomo@enhydra.org
with the text "unsubscribe instantdb" in the body of the email.
If you have other questions regarding this mailing list, send email to
the list admin at owner-instantdb@enhydra.org.