Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Building a complex stored procedure
Message
 
À
31/10/2001 07:16:37
Christopher Pinnock
United General Insurance Company
Kingston, Jamaique
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00575534
Message ID:
00575553
Vues:
35
Hi Christopher,

Ultimately, the Tx will need to be managed by SQL Server, because that is where the activity is occuring.

The best way to handle this with SPT since your title references Stored Procedures.

The first step establish a connection to SQL. Once you have done that, you will want to issue a SQLSetProp() against the connection handle to tell ODBC you will handle the Tx's manually.

Now, you can fetch your data. At this point, you can do whatever modifications you want on the client. Once you are ready to send your updates, spin through your client-side cursors and use the data as the basis of making your stored proc calls to either add/update/delete data. If any one of the procedures fails (remember, you can equip your stored procedures to send back an/several output parameter(s) to inform you whether things worked correctly) - again, if any of the calls fail, simply issue a SQLRollback(). Otherwise, issue a SQLCommit().


HTH
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform