Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Primary Keys
Message
De
06/03/2003 07:11:08
 
 
À
06/03/2003 05:53:29
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00762036
Message ID:
00762064
Vues:
15
I would agree with Hilmar on primary keys being unseen data - we tend to use an integer iID in every table as the primary.

To ensure that nobody books the same slot, you could just index on date, index on time, index on room (I use the term room meaning whatever it is that you're booking) and then have code that looks a bit like...

SELECT * FROM Bookings ;
WHERE iRoom = liRoom ;
AND cTimeSlot = lcTimeSlot ;
AND dWhen = ldWhen

IF _Tally > 0
?'already used'
ELSE
?'can proceed'
ENDIF

If your timeslots are fixed (eg. always half an hour), I'd be tempted to have a table of them [iID i, cDescription c(10)] and reference them as integers. If they are non-fixed you might want to reference them using start and endtimes. Either way, you can just index each field and let rushmore do the rest ;-)

HTH,

JC
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform