Skip to Content.
Sympa Menu

freetds - Re: [freetds] osql and isql -- how to test ODBC config?

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT freetds.org>
  • To: freetds AT lists.ibiblio.org
  • Subject: Re: [freetds] osql and isql -- how to test ODBC config?
  • Date: Tue, 18 Sep 2012 09:31:42 -0400

On Tue, 18 Sep 2012 00:36:34 +0000
Tony Esposito <Tony.Esposito AT region10.org> wrote:

> I tried a SELECT that returns 1 row, 1 column and it still fails with
> SQL RowCount -1. I have been told by the unixODBC group -1 from a
> SQLRowCount is entirely ok

More than OK: normal.

After the server has completed execution of a query, it replies with a
DONE packet. That packet includes two fields: a row count, and an "is
the row count valid" flag. If the row count is invalid, its value is
normally -1.

Why would the server return an invalid count? When it isn't keeping
track. When you issue an insert/update/delete, the returned row count
is always valid. The client has no way to know the count of affected
rows other than hearing from the server. For SELELCT, however, the
row count is never valid. The rows were returned; the client can count
for himself how many there were. After all, the server can't know how
many rows were presented to the user, only how many it sent.

> I did find bsqlodbc1 but not in my build tree. Should I reinstall?

Probably not. The bsqlodbc.1 file was generated from a template and
installed in PREFIX, per the configure script, which
defaults to /usr/local. If man(1) doesn't find it, I'd suggest looking
for it there and updating your man configuration.

$ ./configure --help | grep -E 'datarootdir|mandir'
--datarootdir=DIR read-only arch.-independent data root
[PREFIX/share]
--mandir=DIR man documentation [DATAROOTDIR/man]

HTH.

--jkl




Archive powered by MHonArc 2.6.24.

Top of Page