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: Tony Esposito <Tony.Esposito AT region10.org>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Cc: Tony Esposito <Tony.Esposito AT region10.org>
  • Subject: Re: [freetds] osql and isql -- how to test ODBC config?
  • Date: Tue, 18 Sep 2012 21:40:37 +0000

One more thing -- is there a way to verify/determine the $ODBC_HOME directory
(i.e. the home directory for FreeTDS)? In this case it would probably return
with something like /usr/local/freetds. I need to ensure that another
product is able to access the $ODBC_HOME/lib directory.
Thx. :-)

-----Original Message-----
From: Tony Esposito
Sent: Tuesday, September 18, 2012 2:56 PM
To: freetds AT lists.ibiblio.org
Cc: 'tony.esposito AT region10.org'
Subject: RE: [freetds] osql and isql -- how to test ODBC config?

Thanks James.

See bottom of thread for latest results. Seems to me error 100 means "no
rows returned".
I am making a connection to the correct database.

Tony Esposito
ETL Developer
Information Services Programming
Region 10 Education Service Center
400 E Spring Valley Rd
Richardson, TX 75081
(Ph) 972-348-1284
(Fax) 972-348-1285
Reveal Data Analytics

-----Original Message-----
From: freetds-bounces AT lists.ibiblio.org
[mailto:freetds-bounces AT lists.ibiblio.org] On Behalf Of James K. Lowden
Sent: Tuesday, September 18, 2012 8:32 AM
To: freetds AT lists.ibiblio.org
Subject: Re: [freetds] osql and isql -- how to test ODBC config?

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.
---------------------------------------------------------------------------
(1) Set my MANPATH so now I can find the man pages for bsqlodbc.
(2) Ran bsqlodbc and get the following:

user #> bsqlodbc -U dba -P sql -S txeis -D DB246111 -i input.sql -o
output.sql -e error.sql

Input file input.sql contents: select * from sr_stu_demo;
Output file output.sql contents: <empty>
Error file error.sql contents: bsqlodbc: error: 100 is an unknown return
code for SQLExecute
_______________________________________________





Archive powered by MHonArc 2.6.24.

Top of Page