rick fleischer
rick fleischer

Reputation: 1

Accessing more than 4 billion rows in a 32-bit MS ODBC (C++) application

I have a 32-bit application that must connect to both 32 and 64 bit ODBC databases. I see some MS ODBC functions that have different signatures for 32 and 64 bit builds. That seems to imply that only a 64-bit application can use a 64-bit index. Is that the case?

Upvotes: 0

Views: 108

Answers (2)

wsodbc
wsodbc

Reputation: 11

first, you don't fetch 4 billion rows at one time. if you do so, strange things are going to happen. second, the date type you are talking about is SLQLEN. it is a 4-byte int for 32-bit drivers and 8-byte for 64-bit drivers. however, not all 64bit driver has 8-byte SQLLEN. i have personally worked with more than a dozen 64bit odbc drivers, about 40% of them still use 4-byte SQLLEN (in the mean time, the driver manger should also has 4-byte SQLLEN, otherwise, you will see corrupted data and memory error here and there on some platforms).

Upvotes: 0

bohica
bohica

Reputation: 5990

In the 64 bit ODBC API some arguments are now 8 bytes and were 4 bytes before. However, very few are to do with numbers of rows and more to do with the size of a field (e.g., a lob). The API you quote returns the number of rows affected and no driver I know of sets anything other than -1 for SQLRowCount on a select. Therefore, for SQLRowCount you only need to worry if you are going to update/delete 2 billions rows at once AND need a count of those rows changed/deleted. If you are really going to update/delete 2 billion rows at once you might have greater problems than whether to use 32bit/64bit ODBC API.

Upvotes: 1

Related Questions