Re: Problem retrieveing results from a query with anIMAGE field
"Daniel A. Veiga" <[email protected]>
| Newsgroups | gmane.comp.db.tds.freetds |
|---|---|
| Message-ID | <50417.201.253.227.42.1212595401.squirrel@www.advtechnology.com.ar> |
This is the smaller (16K) log file I could generate that includes the
error. If you search for "SQLFetchScroll" you'll find that the first
rowset (20 rows) are returned with SQL_SUCCESS, but internally
something went wrong, as any other operation (in the example another
SQLFetchScroll to get the next 20 rows) returns SQL_ERROR and state
24000 (Invalid cursor state).
Note 1: The table has more than 40 rows.
Note 2: Only the first row has data in the blob field (about 100
bytes). If SQLFetchScroll does not get any row with data in the blob
field, no error is reported.
Note 3: The log file was generated under Linux. So it does not contain
'\r\n' after each row, only '\n' as it is standard in that OS. If you
open the file from MS Notepad it is not shown correctly. Please use MS
Wordpad if openning under MS Windows instead.
Bye
Daniel
>
>>
>> I'm using a Fedora Core 8 and normally use the "Package Updater" to
>> update my system. But after I faced the problem I don't know where I
>> read that the latest version was only available through CVS.
>> That's why
>> before sending a report I downloaded the latest source code via CVS,
>> recompiled and tested again. The info I sent was taken from version
>> 0.82. The last change in the ChangeLog was "Wed May 21 23:51:21 EDT
>> 2008 JK Lowden <[email protected]>". AFAIK this should be the
>> latest versión.
>> I'm completely new to TDS, but I'm profficient at C programming, so
>> if
>> I can do anything to help just let me know ...
>> Bye
>>
>> Daniel
>>
>
> We released version 0.82 just some weeks ago. Just can find it at
> www.freetds.org.
> To build packages just give a "rpmbuild -ta freetds-0.82.tar.gz".
> I think a more detailed odbc trace as you did for SQLFreeStmt would be
> helpful for us. At least from query to the error.
>
> freddy77
>
_______________________________________________
FreeTDS mailing list
[email protected]
http://lists.ibiblio.org/mailman/listinfo/freetds
sql.log
(application/octet-stream, 15.6 KB)
[ODBC][4588][__handles.c][447] Exit:[SQL_SUCCESS] Environment = 0x703810 [ODBC][4588][SQLDataSources.c][191] Entry: Environment = 0x703810 [ODBC][4588][SQLDataSources.c][387] Exit:[SQL_SUCCESS] [ODBC][4588][SQLDataSources.c][191] Entry: Environment = 0x703810 [ODBC][4588][SQLDataSources.c][387] Exit:[SQL_SUCCESS] [ODBC][4588][SQLAllocHandle.c][358] Entry: Handle Type = 2 Input Handle = 0x703810 [ODBC][4588][SQLAllocHandle.c][476] Exit:[SQL_SUCCESS] Output Handle = 0x705ab0 [ODBC][4588][SQLConnect.c][3586] Entry: Connection = 0x705ab0 Server Name = [DBCONTROL][length = 9] User Name = [NeoLock][length = 7] Authentication = [********][length = 8] UNICODE Using encoding ASCII 'ISO8859-1' and UNICODE 'UCS-2LE' [ODBC][4588][SQLConnect.c][4160] Exit:[SQL_SUCCESS] [ODBC][4588][SQLSetConnectAttr.c][321] Entry: Connection = 0x705ab0 Attribute = SQL_ATTR_CURRENT_CATALOG Value = 0x6713c0 StrLen = -3 [ODBC][4588][SQLSetConnectAttr.c][675] Exit:[SQL_SUCCESS_WITH_INFO] DIAG [01000] [FreeTDS][SQL Server]Changed database context to 'DBCONTROL'. [ODBC][4588][SQLGetDiagRec.c][657] Entry: Connection = 0x705ab0 Rec Number = 1 SQLState = 0x7fff77125410 Native = 0x7fff77125408 Message Text = 0x7fff77124400 Buffer Length = 4096 Text Len Ptr = 0x7fff7712540e [ODBC][4588][SQLGetDiagRec.c][694] Exit:[SQL_SUCCESS] SQLState = 01000 Native = 0x7fff77125408 -> 5701 Message Text = [[FreeTDS][SQL Server]Changed database context to 'DBCONTROL'.] [ODBC][4588][SQLGetInfo.c][224] Entry: Connection = 0x705ab0 Info Type = SQL_TXN_ISOLATION_OPTION (72) Info Value = 0x705a9c Buffer Length = 4 StrLen = (nil) [ODBC][4588][SQLGetInfo.c][544] Exit:[SQL_SUCCESS] [ODBC][4588][SQLGetInfo.c][224] Entry: Connection = 0x705ab0 Info Type = SQL_DEFAULT_TXN_ISOLATION (26) Info Value = 0x705a98 Buffer Length = 4 StrLen = (nil) [ODBC][4588][SQLGetInfo.c][544] Exit:[SQL_SUCCESS] [ODBC][4588][SQLGetInfo.c][224] Entry: Connection = 0x705ab0 Info Type = SQL_SCROLL_OPTIONS (44) Info Value = 0x7fff77125da4 Buffer Length = 4 StrLen = (nil) [ODBC][4588][SQLGetInfo.c][544] Exit:[SQL_SUCCESS] [ODBC][4588][SQLGetInfo.c][224] Entry: Connection = 0x705ab0 Info Type = SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1 (146) Info Value = 0x705a78 Buffer Length = 4 StrLen = (nil) [ODBC][4588][SQLGetInfo.c][544] Exit:[SQL_SUCCESS] [ODBC][4588][SQLGetInfo.c][224] Entry: Connection = 0x705ab0 Info Type = SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2 (147) Info Value = 0x705a88 Buffer Length = 4 StrLen = (nil) [ODBC][4588][SQLGetInfo.c][544] Exit:[SQL_SUCCESS] [ODBC][4588][SQLGetInfo.c][224] Entry: Connection = 0x705ab0 Info Type = SQL_KEYSET_CURSOR_ATTRIBUTES1 (150) Info Value = 0x705a7c Buffer Length = 4 StrLen = (nil) [ODBC][4588][SQLGetInfo.c][544] Exit:[SQL_SUCCESS] [ODBC][4588][SQLGetInfo.c][224] Entry: Connection = 0x705ab0 Info Type = SQL_KEYSET_CURSOR_ATTRIBUTES2 (151) Info Value = 0x705a8c Buffer Length = 4 StrLen = (nil) [ODBC][4588][SQLGetInfo.c][544] Exit:[SQL_SUCCESS] [ODBC][4588][SQLGetInfo.c][224] Entry: Connection = 0x705ab0 Info Type = SQL_STATIC_CURSOR_ATTRIBUTES1 (167) Info Value = 0x705a84 Buffer Length = 4 StrLen = (nil) [ODBC][4588][SQLGetInfo.c][544] Exit:[SQL_SUCCESS] [ODBC][4588][SQLGetInfo.c][224] Entry: Connection = 0x705ab0 Info Type = SQL_STATIC_CURSOR_ATTRIBUTES2 (168) Info Value = 0x705a94 Buffer Length = 4 StrLen = (nil) [ODBC][4588][SQLGetInfo.c][544] Exit:[SQL_SUCCESS] [ODBC][4588][SQLGetInfo.c][224] Entry: Connection = 0x705ab0 Info Type = SQL_DYNAMIC_CURSOR_ATTRIBUTES1 (144) Info Value = 0x705a80 Buffer Length = 4 StrLen = (nil) [ODBC][4588][SQLGetInfo.c][544] Exit:[SQL_SUCCESS] [ODBC][4588][SQLGetInfo.c][224] Entry: Connection = 0x705ab0 Info Type = SQL_EXPRESSIONS_IN_ORDERBY (145) Info Value = 0x705a90 Buffer Length = 4 StrLen = (nil) [ODBC][4588][SQLGetInfo.c][544] Exit:[SQL_SUCCESS] [ODBC][4588][SQLAllocHandle.c][523] Entry: Handle Type = 3 Input Handle = 0x705ab0 [ODBC][4588][SQLAllocHandle.c][1058] Exit:[SQL_SUCCESS] Output Handle = 0x764cc0 [ODBC][4588][SQLSetStmtAttr.c][252] Entry: Statement = 0x764cc0 Attribute = SQL_ATTR_USE_BOOKMARKS Value = (nil) StrLen = 0 [ODBC][4588][SQLSetStmtAttr.c][874] Exit:[SQL_SUCCESS] [ODBC][4588][SQLSetStmtAttr.c][252] Entry: Statement = 0x764cc0 Attribute = SQL_ATTR_CONCURRENCY Value = 0x1 StrLen = 0 [ODBC][4588][SQLSetStmtAttr.c][874] Exit:[SQL_SUCCESS] [ODBC][4588][SQLSetStmtAttr.c][252] Entry: Statement = 0x764cc0 Attribute = SQL_ATTR_CURSOR_TYPE Value = 0x3 StrLen = 0 [ODBC][4588][SQLSetStmtAttr.c][874] Exit:[SQL_SUCCESS] [ODBC][4588][SQLPrepare.c][192] Entry: Statement = 0x764cc0 SQL = [select * from _test order by id ][length = 33 (SQL_NTS)] [ODBC][4588][SQLPrepare.c][367] Exit:[SQL_SUCCESS] [ODBC][4588][SQLExecute.c][183] Entry: Statement = 0x764cc0 [ODBC][4588][SQLExecute.c][344] Exit:[SQL_SUCCESS] [ODBC][4588][SQLGetStmtAttr.c][213] Entry: Statement = 0x764cc0 Attribute = SQL_ATTR_CURSOR_TYPE Value = 0x768dac Buffer Length = 4 StrLen = (nil) [ODBC][4588][SQLGetStmtAttr.c][522] Exit:[SQL_SUCCESS] [ODBC][4588][SQLNumResultCols.c][149] Entry: Statement = 0x764cc0 Column Count = 0x7fff77126d5a [ODBC][4588][SQLNumResultCols.c][234] Exit:[SQL_SUCCESS] Count = 0x7fff77126d5a -> 4 [ODBC][4588][SQLDescribeCol.c][231] Entry: Statement = 0x764cc0 Column Number = 1 Column Name = 0x768df0 Buffer Length = 128 Name Length = 0x7fff77126d5a Data Type = 0x768e70 Column Size = 0x768ef4 Decimal Digits = 0x768ef8 Nullable = 0x7fff77126d58 [ODBC][4588][SQLDescribeCol.c][474] Exit:[SQL_SUCCESS] Column Name = [id] Data Type = 0x768e70 -> 4 Column Size = 0x768ef4 -> 10 Decimal Digits = 0x768ef8 -> 0 Nullable = 0x7fff77126d58 -> 0 [ODBC][4588][SQLColAttribute.c][280] Entry: Statement = 0x764cc0 Column Number = 1 Field Identifier = SQL_DESC_TYPE_NAME Character Attr = 0x768e72 Buffer Length = 128 String Length = 0x7fff77126d5a Numeric Attribute = (nil) [ODBC][4588][SQLColAttribute.c][651] Exit:[SQL_SUCCESS] [ODBC][4588][SQLColAttribute.c][280] Entry: Statement = 0x764cc0 Column Number = 1 Field Identifier = SQL_DESC_AUTO_UNIQUE_VALUE Character Attr = (nil) Buffer Length = 0 String Length = (nil) Numeric Attribute = 0x7fff77126cf8 [ODBC][4588][SQLColAttribute.c][651] Exit:[SQL_SUCCESS] [ODBC][4588][SQLDescribeCol.c][231] Entry: Statement = 0x764cc0 Column Number = 2 Column Name = 0x768f08 Buffer Length = 128 Name Length = 0x7fff77126d5a Data Type = 0x768f88 Column Size = 0x76900c Decimal Digits = 0x769010 Nullable = 0x7fff77126d58 [ODBC][4588][SQLDescribeCol.c][474] Exit:[SQL_SUCCESS] Column Name = [valor] Data Type = 0x768f88 -> 12 Column Size = 0x76900c -> 16 Decimal Digits = 0x769010 -> 0 Nullable = 0x7fff77126d58 -> 1 [ODBC][4588][SQLColAttribute.c][280] Entry: Statement = 0x764cc0 Column Number = 2 Field Identifier = SQL_DESC_TYPE_NAME Character Attr = 0x768f8a Buffer Length = 128 String Length = 0x7fff77126d5a Numeric Attribute = (nil) [ODBC][4588][SQLColAttribute.c][651] Exit:[SQL_SUCCESS] [ODBC][4588][SQLColAttribute.c][280] Entry: Statement = 0x764cc0 Column Number = 2 Field Identifier = SQL_DESC_OCTET_LENGTH Character Attr = (nil) Buffer Length = 0 String Length = (nil) Numeric Attribute = 0x7fff77126cf8 [ODBC][4588][SQLColAttribute.c][651] Exit:[SQL_SUCCESS] [ODBC][4588][SQLDescribeCol.c][231] Entry: Statement = 0x764cc0 Column Number = 3 Column Name = 0x769020 Buffer Length = 128 Name Length = 0x7fff77126d5a Data Type = 0x7690a0 Column Size = 0x769124 Decimal Digits = 0x769128 Nullable = 0x7fff77126d58 [ODBC][4588][SQLDescribeCol.c][474] Exit:[SQL_SUCCESS] Column Name = [blo] Data Type = 0x7690a0 -> -4 Column Size = 0x769124 -> 2147483647 Decimal Digits = 0x769128 -> 0 Nullable = 0x7fff77126d58 -> 1 [ODBC][4588][SQLColAttribute.c][280] Entry: Statement = 0x764cc0 Column Number = 3 Field Identifier = SQL_DESC_TYPE_NAME Character Attr = 0x7690a2 Buffer Length = 128 String Length = 0x7fff77126d5a Numeric Attribute = (nil) [ODBC][4588][SQLColAttribute.c][651] Exit:[SQL_SUCCESS] [ODBC][4588][SQLDescribeCol.c][231] Entry: Statement = 0x764cc0 Column Number = 4 Column Name = 0x769138 Buffer Length = 128 Name Length = 0x7fff77126d5a Data Type = 0x7691b8 Column Size = 0x76923c Decimal Digits = 0x769240 Nullable = 0x7fff77126d58 [ODBC][4588][SQLDescribeCol.c][474] Exit:[SQL_SUCCESS] Column Name = [ID_AUTOINC_] Data Type = 0x7691b8 -> 4 Column Size = 0x76923c -> 10 Decimal Digits = 0x769240 -> 0 Nullable = 0x7fff77126d58 -> 1 [ODBC][4588][SQLColAttribute.c][280] Entry: Statement = 0x764cc0 Column Number = 4 Field Identifier = SQL_DESC_TYPE_NAME Character Attr = 0x7691ba Buffer Length = 128 String Length = 0x7fff77126d5a Numeric Attribute = (nil) [ODBC][4588][SQLColAttribute.c][651] Exit:[SQL_SUCCESS] [ODBC][4588][SQLColAttribute.c][280] Entry: Statement = 0x764cc0 Column Number = 4 Field Identifier = SQL_DESC_AUTO_UNIQUE_VALUE Character Attr = (nil) Buffer Length = 0 String Length = (nil) Numeric Attribute = 0x7fff77126cf8 [ODBC][4588][SQLColAttribute.c][651] Exit:[SQL_SUCCESS] [ODBC][4588][SQLSetStmtAttr.c][252] Entry: Statement = 0x764cc0 Attribute = SQL_ATTR_ROW_BIND_TYPE Value = 0x31 StrLen = 0 [ODBC][4588][SQLSetStmtAttr.c][874] Exit:[SQL_SUCCESS] [ODBC][4588][SQLSetStmtAttr.c][252] Entry: Statement = 0x764cc0 Attribute = SQL_ATTR_ROW_ARRAY_SIZE Value = 0x14 StrLen = 0 [ODBC][4588][SQLSetStmtAttr.c][874] Exit:[SQL_SUCCESS] [ODBC][4588][SQLSetStmtAttr.c][252] Entry: Statement = 0x764cc0 Attribute = SQL_ATTR_ROW_STATUS_PTR Value = 0x769634 StrLen = 0 [ODBC][4588][SQLSetStmtAttr.c][874] Exit:[SQL_SUCCESS] [ODBC][4588][SQLBindCol.c][222] Entry: Statement = 0x764cc0 Column Number = 1 Target Type = 4 SQL_INTEGER Target Value = 0x769260 Buffer Length = 4 StrLen Or Ind = 0x769264 [ODBC][4588][SQLBindCol.c][326] Exit:[SQL_SUCCESS] [ODBC][4588][SQLBindCol.c][222] Entry: Statement = 0x764cc0 Column Number = 2 Target Type = 1 SQL_CHAR Target Value = 0x769268 Buffer Length = 17 StrLen Or Ind = 0x769279 [ODBC][4588][SQLBindCol.c][326] Exit:[SQL_SUCCESS] [ODBC][4588][SQLBindCol.c][222] Entry: Statement = 0x764cc0 Column Number = 4 Target Type = 4 SQL_INTEGER Target Value = 0x769289 Buffer Length = 4 StrLen Or Ind = 0x76928d [ODBC][4588][SQLBindCol.c][326] Exit:[SQL_SUCCESS] [ODBC][4588][SQLFetchScroll.c][152] Entry: Statement = 0x764cc0 Fetch Orentation = 2 Fetch Offset = 0 [ODBC][4588][SQLFetchScroll.c][339] Exit:[SQL_SUCCESS] [ODBC][4588][SQLFetchScroll.c][152] Entry: Statement = 0x764cc0 Fetch Orentation = 6 Fetch Offset = 20 [ODBC][4588][SQLFetchScroll.c][339] Exit:[SQL_ERROR] DIAG [24000] [FreeTDS][SQL Server]Attempt to initiate a new Adaptive Server operation with results pending [ODBC][4588][SQLGetDiagRec.c][735] Entry: Statement = 0x764cc0 Rec Number = 1 SQLState = 0x7fff77126930 Native = 0x7fff77126928 Message Text = 0x7fff77125920 Buffer Length = 4096 Text Len Ptr = 0x7fff7712692e [ODBC][4588][SQLGetDiagRec.c][772] Exit:[SQL_SUCCESS] SQLState = 24000 Native = 0x7fff77126928 -> 20019 Message Text = [[FreeTDS][SQL Server]Attempt to initiate a new Adaptive Server operation with results pending] [ODBC][4588][SQLFreeStmt.c][140] Entry: Statement = 0x764cc0 Option = 2 [ODBC][4588][SQLFreeStmt.c][246] Exit:[SQL_SUCCESS] [ODBC][4588][SQLFreeStmt.c][140] Entry: Statement = 0x764cc0 Option = 3 [ODBC][4588][SQLFreeStmt.c][246] Exit:[SQL_SUCCESS] [ODBC][4588][SQLFreeHandle.c][372] Entry: Handle Type = 3 Input Handle = 0x764cc0 [ODBC][4588][SQLFreeHandle.c][471] Exit:[SQL_SUCCESS] [ODBC][4588][SQLDisconnect.c][204] Entry: Connection = 0x705ab0 [ODBC][4588][SQLDisconnect.c][341] Exit:[SQL_SUCCESS] [ODBC][4588][SQLFreeHandle.c][273] Entry: Handle Type = 2 Input Handle = 0x705ab0 [ODBC][4588][SQLFreeHandle.c][324] Exit:[SQL_SUCCESS] [ODBC][4588][SQLFreeHandle.c][206] Entry: Handle Type = 1 Input Handle = 0x703810