Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Handling errors inside a transaction
Message
 
À
26/06/2001 05:45:41
Walter Meester
HoogkarspelPays-Bas
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00523402
Message ID:
00523513
Vues:
13
>Hi alonso
>
>How about a ROLLBACK and handle the error ? thus:
>
>IF lError
>   ROLLBACK
>ELSE
>   END TRANSACTION
>ENDIF
>...
>...
>IF lError
>   .. handle the error
>ENDIF
>
>Walter,
>
>>How can i "friendly" handle errors inside a transaction?
>>
>>I was thinking about something like this:
>>
>>
>>
>>xOldError = ON("ERROR")
>>
>>BEGIN TRANS
>>
>>ON ERROR xError = .T.
>>
>>&& inserts, updates and stuff go here
>>
>>if xError == .T.
>>
>>&& not sure about what to put in here!!!
>>
>>endif
>>
>>ENDTRANS
>>
>>ON ERROR &xOldError
>>
>>
>>Any help is welcome.
>>
>>TIA,
>>
>>Alonso

Walter,

I was thinking about something that i could tell the user exactlly what happened. Something like "Duplicated PK" (this i check before BEGIN TRANS), etc.

So, i would issue a ROLLBACK knowing why i had to.

OK??

Thanks!
Like Frank said: "I did it... MY WAY!"
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform