Skip to content

Commit 91cb6bd

Browse files
committed
ODBC changes
1 parent 8085b06 commit 91cb6bd

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

source/ddbc/drivers/odbcddbc.d

+13-6
Original file line numberDiff line numberDiff line change
@@ -1437,14 +1437,21 @@ version (USE_ODBC)
14371437

14381438
// returns one of SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_NO_DATA, SQL_STILL_EXECUTING, SQL_ERROR, or SQL_INVALID_HANDLE
14391439
// see: https://learn.microsoft.com/en-us/sql/odbc/reference/syntax/sqlfetchscroll-function
1440-
SQLRETURN r = SQLFetchScroll(stmt.stmt, SQL_FETCH_FIRST, 0);
1440+
SQLRETURN retcode = SQLFetchScroll(stmt.stmt, SQL_FETCH_FIRST, 0);
14411441

1442-
return r == SQL_SUCCESS;
1442+
// switch (retcode) {
1443+
// case SQL_NO_DATA:
1444+
// return false;
1445+
// }
14431446

1444-
/*
1445-
currentRowIndex = 0;
1446-
return check(r, stmt.stmt, SQL_HANDLE_STMT) != SQL_NO_DATA;
1447-
*/
1447+
if(retcode != SQL_NO_DATA) {
1448+
currentRowIndex = 0;
1449+
return true;
1450+
1451+
} else {
1452+
// check(retcode, stmt.stmt, SQL_HANDLE_STMT);
1453+
return false;
1454+
}
14481455
}
14491456

14501457
override bool isFirst()

0 commit comments

Comments
 (0)