[V4MD] AUTO INCREMENT?

Martin Kloss martin.kloss at gmx.de
Tue Nov 11 10:34:13 CST 2003


At 04:46 11.11.2003, you wrote:
>I come from a mySQL background. Is there a way in Valentina to simulate AUTO
>INCREMENT ? I want to create primary key ids for each of my tables, and 
>have the
>ids created automatically when I do an insert.

You can always use the "RecID", which is automatically created for you.
But it's important to know that a RecID will be recycled, so once you delete
a record that RecID will be used for the next record.

This is also important if you sort by RecID, because adding records then
means that you will not get new records appended to the end of the list,
obviously.

If you need a field to sort by, which does not recycle values then you have
to do it yourself. You can always create an integer "ID" field and get the
max value before doing an insert or storing max value in a separate "settings"
table in your db or store it somewhere else in a text file or wherever :-)

I think an auto-increment field flag is targeted for 2.0, though. Ruslan?

Martin.


Martin Kloss

Need music? http://www.selling-sound.com

Like the author? Buy the book at:
http://www.amazon.de/exec/obidos/ASIN/3898422194/lingmmugd

Get your daily dose of Lingo at the LingoPark:
http://www.lingopark.de





More information about the Valentina mailing list