Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Records update for SQL
Message
De
22/11/2002 15:37:53
 
 
À
21/11/2002 22:42:13
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00723076
Message ID:
00725997
Vues:
17
>Dear Vlad Grynchyshyn,
>
>Thank you for your help and I tested. It returned no. of records processed using VFP Native SQL Command. When I use SQLExec to issue the SQL command via ODBC, it can't. Do you know have any way to return no. of records processed? Thanks a lot....
>
>Best Regards,
>
>Justy Chow


You can use the @@ROWCOUNT system variable to get this provided you execute it immediately after the update. So, you'd do something like this in VFP:
=sqlexec(liConnection,"update table set x = y where {condition};" + ;
   "select @@rowcount as rowcount",curResults)
?curResults.rowcount
The trick is "chaining" the commands together. The semicolon in the middle of the command string does that.
Dan LeClair
www.cyberwombat.com
SET RANT ON - The Wombat Blog

Life isn’t a morality contest and purity makes a poor shield. - J. Peter Mulhern
Disclaimer: The comments made here are only my OPINIONS on various aspects of VFP, SQL Server, VS.NET, systems development, or life in general, and my OPINIONS should not be construed to be the authoritative word on any subject. No warranties or degrees of veracity are expressed or implied. Void where prohibited. Side effects may included dizziness, spontaneous combustion, or unexplainable cravings for dark beer. Wash with like colors only, serve immediately for best flavor.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform