Skip to content

Commit

Permalink
ODBC changes
Browse files Browse the repository at this point in the history
  • Loading branch information
SingingBush committed Nov 3, 2024
1 parent 91cb6bd commit 9d9b0e2
Showing 1 changed file with 23 additions and 22 deletions.
45 changes: 23 additions & 22 deletions source/ddbc/drivers/odbcddbc.d
Original file line number Diff line number Diff line change
Expand Up @@ -1430,28 +1430,29 @@ version (USE_ODBC)

override bool first()
{
checkClosed();
lock();
scope (exit)
unlock();

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

// switch (retcode) {
// case SQL_NO_DATA:
// return false;
// }

if(retcode != SQL_NO_DATA) {
currentRowIndex = 0;
return true;

} else {
// check(retcode, stmt.stmt, SQL_HANDLE_STMT);
return false;
}
return isFirst();

//checkClosed();
//lock();
//scope (exit)
// unlock();
//
//// returns one of SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_NO_DATA, SQL_STILL_EXECUTING, SQL_ERROR, or SQL_INVALID_HANDLE
//// see: https://learn.microsoft.com/en-us/sql/odbc/reference/syntax/sqlfetchscroll-function
//SQLRETURN retcode = SQLFetchScroll(stmt.stmt, SQL_FETCH_FIRST, 0);
//
//// switch (retcode) {
//// case SQL_NO_DATA:
//// return false;
//// }
//
//if(retcode != SQL_NO_DATA) {
// currentRowIndex = 0;
// return true;
//} else {
// // check(retcode, stmt.stmt, SQL_HANDLE_STMT);
// return false;
//}
}

override bool isFirst()
Expand Down

0 comments on commit 9d9b0e2

Please sign in to comment.