Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
TRANSACTION - are some lines excess here ?
Message
 
 
À
01/04/2008 12:05:38
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01307383
Message ID:
01307385
Vues:
10
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform