Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Inserting a record between two records
Message
De
22/02/2006 13:05:22
 
 
À
22/02/2006 12:48:31
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01098167
Message ID:
01098194
Vues:
18
>Could you elaborate a bit, please?

to insert a record in the physical table's position N
is as to
- define a integer field
- define a index on field TAG host
- set the active order to the "host" index tag

* insert
- set field = field + 1 for all records with field >= N
and set the insert record's field value to N ( this put the key in physical tag's position N)
* with code
TRY
* BEGIN  TRAN or tablebuffer with FLOCK()
 
 SET ORDER host DESCENDING
 REPLACE ALL WHILE field>=N field with field + 1
 INSERT ... FIELD ... VALUES ... N ....
* END TRAN or tableupdate() and unlock
CATCH
* ROLLBACK
FINALLY
 SET ORDER host
ENDTRY
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform