Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to retrieve the number of rows deleted
Message
De
18/07/2005 13:10:46
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Titre:
How to retrieve the number of rows deleted
Versions des environnements
Visual FoxPro:
VFP 7
Divers
Thread ID:
01033589
Message ID:
01033589
Vues:
71
I run
SQLEXEC( nConn, "DELETE FROM mytable WHERE mycondition")
against Postgres SQL database
and want to know how many rows this command deletes.

sqlexec() does not return number of rows deleted, there is no SQLRowCount() function or access to ODBC result header from VFP. There is not @@RowCount like variable or function in Postgres.

Any idea ?

ODBC specs say:

After an application updates, deletes, or inserts rows, it can call
SQLRowCount to determine how many rows were affected. SQLRowCount returns
this value whether or not the rows were updated, deleted, or inserted by
executing an UPDATE, DELETE, or INSERT statement, by executing a
positioned update or delete statement, or by calling SQLSetPos.

..

The number of affected rows is also returned in the SQL_DIAG_ROW_COUNT
diagnostic header field in the diagnostic area associated with the
statement handle. However, the data in this field is reset after every
function call on the same statement handle, whereas the value returned by
SQLRowCount remains the same until a call to SQLBulkOperations,
SQLExecute, SQLExecDirect, SQLPrepare, or SQLSetPos.
Andrus
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform