To be unique just declare it as:
REATE TABLE foo (uniqueID integer PRIMARY KEY AUTOINCREMENT, ...)
---
Marco Bambini
http://www.sqlabs.net
http://www.sqlabs.net/blog/
http://www.sqlabs.net/realsqlserver/
On Oct 16, 2006, at 5:46 PM, Norman Palardy wrote:
On Oct 16, 2006, at 3:46 AM, Youri wrote:
Gerard,
Thank you for the links.
Regarding the Unique ID being an Integer, how can I trust an
Integer to be unique?
You'd expect the database to insure this.
However, if you do something like
create table 1
add rows to table 1
add related rows in other tables
delete rows in table 1
you will have rows in your other tables with no related row in
table 1 (as expected) if you use rowid as the primary key
If you now do
delete all rows in table 1
add rows to table 1
you will find the row id are reused
rowids are unique in the table within the data set it currently
holds but not unique for the entire existence of the table
Try it (I just did to confirm this before writing)
You may want something like what EOF does where they have a table
that is like
tablename
key
and every time you need a new key for the table you select the
current key value from this table based on what table you are going
to insert to and increment it
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>