Date: Tuesday, January 17, 2006 @ 16:02:38
Author: marc
Path: /cvsroot/carob/odbsequoia/src
Modified: simpletest.c (1.7 -> 1.8)
Modified to test SQL_DIAG_ROW_COUNT
--------------+
simpletest.c | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
Index: odbsequoia/src/simpletest.c
diff -u odbsequoia/src/simpletest.c:1.7 odbsequoia/src/simpletest.c:1.8
--- odbsequoia/src/simpletest.c:1.7 Mon Jan 16 20:01:33 2006
+++ odbsequoia/src/simpletest.c Tue Jan 17 16:02:38 2006
@@ -11,6 +11,11 @@
#define SEQTEST 1 // else postgreSQL
+SQLSMALLINT ignoredBufLen = 0; // should be zero because of "2nd bug" linked
to above
+SQLSMALLINT * ignoredLenPtr = (SQLSMALLINT *) 0;
+SQLSMALLINT ignoredRecNum = 5243;
+
+
void print_diags(int pc, SQLSMALLINT hdletype, SQLHANDLE hdle)
{
SQLINTEGER irec, recmax;
@@ -20,9 +25,6 @@
SQLINTEGER nativecode;
SQLCHAR msg[201];
- SQLSMALLINT ignoredBufLen = 0; // should be zero because of "2nd bug"
linked to above
- SQLSMALLINT * ignoredLenPtr = (SQLSMALLINT *) 0;
- SQLSMALLINT ignoredRecNum = 5243;
SQLGetDiagField(hdletype, hdle, ignoredRecNum, SQL_DIAG_NUMBER, &recmax,
ignoredBufLen, ignoredLenPtr);
@@ -121,13 +123,17 @@
"set cost=3.1422 where ID=1", SQL_NTS),
SQL_HANDLE_STMT, hstmt, 0);
- SQLINTEGER uc = 0;
+ SQLLEN uc = 0;
+
+ SQLGetDiagField(SQL_HANDLE_STMT, hstmt, 4543, SQL_DIAG_ROW_COUNT,
+ &uc, ignoredBufLen, ignoredLenPtr);
+ printf ("%ld rows were updated\n", uc);
+
EXEC_AND_DIAGS(
SQLRowCount(hstmt, &uc),
SQL_HANDLE_STMT, hstmt, 0);
-
- printf ("%ld rows were updated\n", uc);
+ printf ("%ld rows were updated (through SQLRowCount) \n", uc);
return 0;
}
_______________________________________________
Carob-commits mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/carob-commits