Re: osql and isql -- how to test ODBC config?
"James K. Lowden" <[email protected]>
| Newsgroups | gmane.comp.db.tds.freetds |
|---|---|
| Message-ID | <[email protected]> |
On Tue, 18 Sep 2012 00:36:34 +0000 Tony Esposito <[email protected]> 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