Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Transaction syntax
Message
From
12/04/2004 15:55:39
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Transaction syntax
Miscellaneous
Thread ID:
00894208
Message ID:
00894208
Views:
47
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
Next
Reply
Map
View

Click here to load this message in the networking platform