Karthi S
March 25th, 2002, 09:58 AM
Hi,
I got struck up in getting long data (Blob data) through SQLGetData.
The Following is the snippet from MSDN under the title
"Getting long data". It says as follows.
There are a number of restrictions on using SQLGetData. In general, columns accessed with SQLGetData:
1)Must be accessed in order of increasing column number (because of the way the columns of a result set are read from the data source). For example, it is an error to call SQLGetData for column 5 and then call it for column 4.
Cannot be bound.
2)Must have a higher column number than the last bound column. For example, if the last bound column is column 3, it is an error to call SQLGetData for column 2. For this reason, applications should be careful to place long data columns at the end of the select list.
So, it means like the "Long data" should be queried as the last parameter in the "Select Query", if we do binding for some columns through "SQLBindCol" and fetching the values for those columns through "SQLFetch" and using "SQLGetData" for the unbound columns(i.e for Long Data).
I have tested by putting the "Long Data" in the beginning of Select query it works through OLEDB,but the same query fails through ODBC.
If this is the case, could any of you explain me how the OLEDB is handling this scenario or Is there any way to overcome this problem with still querying "long data" in any position of the select query.
Your comments are welcome.
Regards,
Karthi
I got struck up in getting long data (Blob data) through SQLGetData.
The Following is the snippet from MSDN under the title
"Getting long data". It says as follows.
There are a number of restrictions on using SQLGetData. In general, columns accessed with SQLGetData:
1)Must be accessed in order of increasing column number (because of the way the columns of a result set are read from the data source). For example, it is an error to call SQLGetData for column 5 and then call it for column 4.
Cannot be bound.
2)Must have a higher column number than the last bound column. For example, if the last bound column is column 3, it is an error to call SQLGetData for column 2. For this reason, applications should be careful to place long data columns at the end of the select list.
So, it means like the "Long data" should be queried as the last parameter in the "Select Query", if we do binding for some columns through "SQLBindCol" and fetching the values for those columns through "SQLFetch" and using "SQLGetData" for the unbound columns(i.e for Long Data).
I have tested by putting the "Long Data" in the beginning of Select query it works through OLEDB,but the same query fails through ODBC.
If this is the case, could any of you explain me how the OLEDB is handling this scenario or Is there any way to overcome this problem with still querying "long data" in any position of the select query.
Your comments are welcome.
Regards,
Karthi