Skip to Content.
Sympa Menu

freetds - [freetds] Question on a problem using freeTDS/unixODBC and SQLAPI interface

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Bearak, Arnold - 0999 - MITLL" <abearak AT ll.mit.edu>
  • To: "freetds AT lists.ibiblio.org" <freetds AT lists.ibiblio.org>
  • Subject: [freetds] Question on a problem using freeTDS/unixODBC and SQLAPI interface
  • Date: Tue, 17 May 2011 12:18:58 -0400

I am having an issue trying to create an application that uses the SQLAPI++
interface to make requests from a 64bit linux system to an MSSQL database.

I cannot make consecutive queries to my MSSQL data base without getting
errors. I can make a request like "select Id from table xxx" and then
display the id from each row of the table. However, if I try to make that
same request a 2nd time, the select is successful, but no rows are
returned, and if I try it a third time, the query fails all together.
I have turned on tds logging, and thre received packets from the queries
validate this information. I have included a snippet from the freetds log
below from my 2nd and 3rd queries.
I did not set things up, so I don't know if there is a configuration issue
that might be impacting my requests. Any suggestions would be appreciated.

Thank You,

Arnie

The unixODBC version I am using is version unixODBC-2.2.11-7.1
Some information from the /etc/odbcinst.ini

[PostgreSQL]
Description = ODBC for PostgreSQL
Driver = /usr/lib/libodbcpsql.so
Setup = /usr/lib/libodbcpsqlS.so
FileUsage = 1

[FreeTDS]
Description = v.82 with protocol 8.0
Driver = /usr/lib64/libtdsodbc.so.0
UsageCount = 2

Then the received packet that my 2nd attempt to read data from a table
succeeded, but did not return any results. The rows affected for this
query was 0.
net.c:671:Received packet
0000 a0 01 00 00 a1 05 00 07-00 20 00 38 fd 10 00 c1 |........ . .8....|
0010 00 00 00 00 00 - |.....|
token.c:510:processing result tokens. marker is a0(COLNAME)
mem.c:563:tds_free_all_results()
token.c:510:processing result tokens. marker is a1(COLFMT)
token.c:977:processing result. type = 56(int), varint_size 0
util.c:162:Changed query state from READING to PENDING
odbc.c:3269:odbc_process_tokens: tds_process_tokens returned 1
odbc.c:3270: result_type=4049, TDS_DONE_COUNT=10, TDS_DONE_ERROR=0
odbc.c:3340:odbc_process_tokens: returning result_type 4049
odbc.c:3119:_SQLExecute: odbc_process_tokens returned result_type 4049
token.c:495:tds_process_tokens(0x138a7ec0, 0x7fffbe9007f4, 0x7fffbe9007f0,
0x6914)
util.c:162:Changed query state from PENDING to READING
token.c:510:processing result tokens. marker is fd(DONE)
token.c:2201:tds_process_end: more_results = 0
was_cancelled = 0
error = 0
done_count_valid = 1
token.c:2217:tds_process_end() state set to TDS_IDLE
util.c:162:Changed query state from READING to IDLE
token.c:2232: rows_affected = 0
util.c:110:logic error: cannot change query state from IDLE to PENDING

And that my third attempt seemed to fail as the received packet looked empty

et.c:671:Received packet
0000 fd 00 00 c0 00 00 00 00-00 |........ .|
token.c:510:processing result tokens. marker is fd(DONE)
token.c:2201:tds_process_end: more_results = 0
was_cancelled = 0
error = 0
done_count_valid = 0
token.c:2217:tds_process_end() state set to TDS_IDLE
util.c:162:Changed query state from READING to IDLE
token.c:2232: rows_affected = 0
util.c:110:logic error: cannot change query state from IDLE to PENDING







  • [freetds] Question on a problem using freeTDS/unixODBC and SQLAPI interface, Bearak, Arnold - 0999 - MITLL, 05/17/2011

Archive powered by MHonArc 2.6.24.

Top of Page