Don't forget that in a relational SQL based database it is good practice
wherever possible to build a unique key from actual data in the row( record
) . This might very often require a JOINT key to be used,  for example
surname and postcode.  To use automatically generated numeric keys for every
table is often missing out on some of the benefits of an SQL based
relational databae ( in fact it has more in common with the older "network"
style databases like 4D) . For example by using a joint key composed of data
in your row, you are ensuring a level of data validation and integrity. For
example the database can ensure that there is no duplication of records with
the same surnamer and postcode.  Sometimes, in order to avoid the
performance hit of joint keys, developers will create a single text column
holding a concatenation of two other columns such as surname+postcode.  This
is done to use a single index as opposed to two.

Automaticaly generated integer keys should only really be used where there
no suitable ( user entered ) data in the table that can uniquely identify
the row.

Sorry if this is teaching grannies to suck eggs, but its worth repeating -
for those new to the world of IT or systems analysis.

Regards


Dan

On 16/10/06 10:52, "fiór Sigur›sson" <[EMAIL PROTECTED]> wrote:

> You can trust the rowid to be unique - while the data is in the DB.
> 
> At the moment you export the data, you cant, since you should never try to
> insert the rowid yourself.
> 
> The best solution is to normalize your data so that each table is left with
> a unique identifier ( primary key ) for you to work on, and leave the rowid
> to the db's perusal.
> 
> /Þór
> 
> ----- Original Message -----
> From: "Youri" <[EMAIL PROTECTED]>
> To: "REALbasic NUG" <[email protected]>
> Sent: Monday, October 16, 2006 9:46 AM
> Subject: Re: Unique Id
> 
> 
>> 
>> Gerard,
>> 
>> Thank you for the links.
>> 
>> Regarding the Unique ID being an Integer, how can I trust an Integer to be
>> unique?
>> 
>> If this "rowid" is generated by SQLite, how will it be treated when
>> exporting datas out of the DB and back? How to maintain the "link" between
>> tables if I use these rowid for JOINS?
>> 
>> Concerning FileMaker, it is a very nice tool and on its latest versions is
>> getting really powerfull. Still not a real "language", and devoted to DB
>> development only. One really good thing is its lack of major bugs, and
>> fantastic stability. Now RB gives much much more in term of possibilities
>> of development ;-)
>> 
>> 
>> Cheers,
>> 
>> 
>> Youri
>> 
>> 
>> 
>> Dr Gerard Hammond wrote:
>>> Hi Youri,
>>> 
>>> I use and recommend SQLlite manager.
>>> http://www.sqlabs.net/sqlitemanager.php
>>> It is well worth the small $'s.
>>> 
>>> An alternative is my own SyBrowser http://www.macsos.com.au but for you I
>>> recommend Marco's super app.
>>> 
>>> PS.
>>> An integer key is quite standard and probably the most efficient in terms
>>> of speed and space. Much more so than a varchar string.
>>> 
>>> PPS.
>>> FileMaker is a really good thing to start with and a great thing to
>>> leave..... ;-)
>>> 
>>> 
>>> 
>>> At 9:03 AM +0200 16/10/06, Youri wrote:
>>>> Thanks Gerard,
>>>> 
>>>> Relying on an Integer seems a strange behavior to me for a unique key.
>>>> 
>>>> Coming from FileMaker world I took the habit to define my own keys, sort
>>>> of : "aer458yh56h8u45" usually on 10 to 15 character, define me as a
>>>> paranoiac if you whish to ;-)
>>>> 
>>>> That is why I was looking for a lead on how to define such a key easily
>>>> with RB.
>>>> 
>>>> 
>>>> Have a nice day in the "Land down under",
>>>> 
>>>> Youri
>> _______________________________________________
>> 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>
> 


_______________________________________________
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>

Reply via email to