Re: osql and isql -- how to test ODBC config?
Tony Esposito <[email protected]>
| Newsgroups | gmane.comp.db.tds.freetds |
|---|---|
| Message-ID | <197C3C50EA91BF4DBE52558A4007816B4350D19C@SN2PRD0202MB131.namprd02.prod.outlook.com> |
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: [email protected] Cc: '[email protected]' 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: [email protected] [mailto:[email protected]] On Behalf Of James K. Lowden Sent: Tuesday, September 18, 2012 8:32 AM To: [email protected] Subject: Re: [freetds] osql and isql -- how to test ODBC config? 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. --------------------------------------------------------------------------- (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 _______________________________________________