Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Exchanging records from two tables
Message
De
02/07/2006 18:02:42
 
 
À
02/07/2006 05:52:46
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01133308
Message ID:
01133339
Vues:
13
>Hi,
>How to exchange records between two tables which have exactly the same structure with exactly the same number of records in a snap?Thank you.
>
>Regards
>
>Syah N

with exclusive access:
try
step=0
renameTable("table1","randomName")
step=1
renameTable("table2","table1")
step=2
renameTable("randomName","table2")
step=3
catch
  try
    if inlist(m.step,3,0)
     * impossible
     exit
   endif
   if m.step=2
     renameTable("table1","table2")
   endif
   * m.step= 1|2
   renameTable("randomName","table1")
   
  catch
     * fatal
  endtry
endtry
but it is not a snap.

try BEGIN TRAN ... for this.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform