Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
TRANSACTION - are some lines excess here ?
Message
 
 
To
01/04/2008 12:05:38
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01307383
Message ID:
01307385
Views:
9
>Hi all,
>This code works but I am sure it could be improved.Any sugestions wellcome.
>
>*--------------------------------------------------------------------------
>PROCEDURE brisiPREDMET( lp1 )
>IF PARAMETERS() < 1
>   RETURN .F.
>ENDIF
>*
>luspjeh2 = .F.
>ulaz = 0
>ulaz = lp1
>*
>SET MULTILOCKS ON
>USE ODGOVORI in 0
>=CURSORSETPROP("Buffering",5)
>USE TEME in 0
>SELECT TEME
>=CURSORSETPROP("Buffering",5)
>*
>BEGIN TRANSACTION
>      *
>      DELETE from  TEME  WHERE postid == lp1
>      *
>      SELECT ODGOVORI
>      DELETE from  ODGOVORI  WHERE postid == lp1
>      *
>      luspjeh2 = TABLEUPDATE(1, .T., 'Odgovori')
>      luspjeh2 = TABLEUPDATE(1, .T., 'Teme')
>      *
>      if luspjeh2
>         END TRANSACTION
>      else
>         ROLLBACK
>         =TABLEREVERT( .T., 'Teme')
>         =TABLEREVERT( .T., 'Odgovori')
>      endif
>      *
>UNLOCK ALL
>CLOSE  ALL
>ENDPROC
>*--------------------------------------------------------------------------------------------
>
>
>TIA
>Gojko

Open transaction right before TABLEUPDATE command. Don't use it at the beginning of the code.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform