VStudio - Can I make RecID my Primary Key? - I recommend - NO

Barry G. Sumpter BarrySum at BigPond.Net.AU
Thu May 31 20:11:59 CDT 2007


Or mark as deleted and never actually delete the record from the database.
Yuck.

-----Original Message-----
From: valentina-studio-bounces at lists.macserve.net
[mailto:valentina-studio-bounces at lists.macserve.net] On Behalf Of Barry G.
Sumpter
Sent: Friday, 1 June 2007 10:32 AM
To: valentina-studio at lists.macserve.net
Subject: RE: VStudio - Can I make RecID my Primary Key? - I recommend - NO

MSAccess was doing this at one time.
Where we would execute a compact/repair,
And find the indexes for Primary Keys had been resequenced to recover the
numbers.  As I first recall, whether deleted or not. lol

But changed in later versions to recover the delete space WITHOUT reuse of
the RecIDs.

--

The only way around this, that I recall, is to setup Cascade Deletes where
you can't delete a parent record (i.e. unique RecID) until all associated
child records have been previously deleted.  Thereby removing any
association to the specific RecID.

--

WARNING - any kind of archiving of live db to history db using the RecID
(after Valentina recovery of RecIDs) will make the history db RecIDs
duplicated.

--

Unless something has changed in v3 or there is some doco I havn't read yet,
my recommendation is NOT to use RecID in this manner.

-----

Field RecID
Each Table of Valentina always have field with name RecID.
The field RecID identifies a record in the scope of Table. The Value of this
field actually is physical address of a record. The first physical record
have RecID equal to 1. The size of this field is 4 bytes, its type is ULONG.
Therefore in a Table we can have up to 4 billions of records. The beaty of
this field is that its values are not store on the HDD.
The RecID value of a record is never changed during its life because
Valentina never move records on deletion, but mark them as deleted and later
reuse space of deleted records. Therefore, RecID field in many cases can be
used as identifier of record, so developer can do not care about Key Fields
of Tables.
Notes: RecID field is not direct analog of Key Field based on an integer
field with, because values of RecID field can be reused. If your task do not
allow such behavior then you should define ID field in your Table(s) and
Foreign Key in the child Table(s).





-----Original Message-----
From: valentina-studio-bounces at lists.macserve.net
[mailto:valentina-studio-bounces at lists.macserve.net] On Behalf Of Barry G.
Sumpter
Sent: Friday, 1 June 2007 9:07 AM
To: valentina-studio at lists.macserve.net
Subject: RE: VStudio - Can I make RecID my Primary Key?

Since the RecID never changes,
Can I make it my Primary key?

If so, how?

baz

_______________________________________________
Valentina-studio mailing list
Valentina-studio at lists.macserve.net
http://lists.macserve.net/mailman/listinfo/valentina-studio

_______________________________________________
Valentina-studio mailing list
Valentina-studio at lists.macserve.net
http://lists.macserve.net/mailman/listinfo/valentina-studio



More information about the Valentina-studio mailing list