Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Exchanging records from two tables
Message
From
02/07/2006 18:02:42
 
 
To
02/07/2006 05:52:46
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01133308
Message ID:
01133339
Views:
12
>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.
Previous
Reply
Map
View

Click here to load this message in the networking platform