Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Transaction syntax
Message
De
12/04/2004 15:55:39
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Transaction syntax
Divers
Thread ID:
00894208
Message ID:
00894208
Vues:
46
Hi all,

How does TRANSACTIONS work? Is this the correct usage for updating a parent/child data?
* Buffering = 5

select vw_parent
update vw_parent set parentdata = "Parent" where pkfld = 1

select vw_child
for i = 1 to 5
update vw_child set dtldata = sys(2007,transform(i)) && sample data
where fkfld = 1 and childline = i

begin transaction
  select vw_child
  if !tableupdate(.t.,.t.)
     rollback
  else
     select vw_parent
     if !tableupdate(.t.,.t.)
        rollback && vw_parent
        select vw_child
        rollback && is this necessary?
     endif
  endif
end transaction
ramil
~~ learning to stand still
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform