Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Linhas alteradas pelo MySQL usando update
Message
De
19/08/2003 21:26:34
Peter Wagner
Point Informática Ltda.
Limeira, Brésil
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00821567
Message ID:
00821644
Vues:
17
This message has been marked as the solution to the initial question of the thread.
Uma forma de obter quantos registros foram afetados é consultando o driver de ODBC, pois ele armazena esta informação (pelo menos o do SQL Server).
Esta informação vc pode obter via API, p/ consultar o Driver de ODBC.
Da uma pesquisada pelo site da UT...

Lembro de parte do código postado por Anatoliy Mogylevets como exemplo, ID da thread: 810276
#DEFINE SQL_SUCCESS  0

DECLARE SHORT SQLRowCount IN odbc32;
	INTEGER StatementHandle, INTEGER @RowCountPtr

DECLARE SHORT SQLExecDirect IN odbc32;
	INTEGER StmtHandle, STRING StmtText, INTEGER TextLen

LOCAL hFoxConn, hStmt, cStmt, nCount

hFoxConn = SQLConnect('foxx')
IF hFoxConn = -1
	? 'Connection handle is invalid.'
	RETURN
ENDIF

* obtaining real statement handle
hStmt = SQLGetProp(hFoxConn, "ODBChstmt")

* SQL statement to be executed
cStmt = "UPDATE products SET price=4.12 WHERE item LIKE 'IK%'"

IF SQLExecDirect(hStmt, cStmt, Len(cStmt)) = SQL_SUCCESS
	nCount=0
	IF SQLRowCount(hStmt, @nCount) = SQL_SUCCESS
		? 'Records modified:', nCount
	ELSE
		? 'SQLRowCount: ODBC error'
	ENDIF
ELSE
	? 'SQLExecDirect: ODBC error'
ENDIF

= SQLDisconnect(hFoxConn)
Provavelmente existem outras formas...
Se descobrir avisa.

[],s

Peter
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform