Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Incrementing a field automatically

Quote Reply
Incrementing a field automatically
I searched you forum about this and found an item on "autoincrement". This is kind of what I want to do, but we don't want to do any programming. Here is some background info.:
We are creating a library database. This database has a field that is called "accession number". We are converting the existing data from a MS Access database. We have about 12K records existing. The accession numbers are up to over 21,000 and they are the identifier for items found in our collection. This processing has been going-on for some time. We have successfully imported a test file into Links (we had to clean up a lot of garbage characters). Here are our questions:
1. Accession Number was an autoincrement field in the old Access database. We want to keep these numbers. Converting these numbers in our collection would be difficult or impossible. How can we add an autoincrement value and have it increment by 1 everytime someone inserts a new item.
2. Since our existing autoincrement values start at approx. 21000, how can we get the autoincrement to start at some value higher than that (the number doesn't matter as long as it is in the range of the integer type that Links is using).

Thanks,
Dave Capuano
Quote Reply
Re: [dscapuano] Incrementing a field automatically In reply to
If you go to admin->database->mysqlman you can edit the properties of the field and set it to autoincrement. You would then need to go to admin->database->Links->properties and resync the database.

I assume that if you do this after you have imported the records it will start from the last number - but I'm not certain about this.