[unixODBC-support] FW: [freetds] osql and isql -- how to test ODBC config?

Tony Esposito Tony.Esposito at region10.org
Tue Sep 18 01:16:31 BST 2012


Hello again,
	Also, since 'isql help' command is working, we know then that the ODBC API is being referenced 'ok' since 'help' uses the SQL Columns and SQLTables API calls.  It appears that when a SELECT is done, the SQLPrepare ODBC API call is failing maybe due to not know how to handle the rows returned.  I tried a SELECT which returns 1 row, 1 column and I still get the error SQLRowCount returns -1.
	HTH

-----Original Message-----
From: unixodbc-support-bounces at mailman.unixodbc.org [mailto:unixodbc-support-bounces at mailman.unixodbc.org] On Behalf Of Nick Gorham
Sent: Monday, September 17, 2012 3:41 AM
To: Support for the unixODBC project
Subject: Re: [unixODBC-support] FW: [freetds] osql and isql -- how to test ODBC config?

On 17/09/12 02:27, Tony Esposito wrote:
> isql 'help' works but not any select statements get SQLRowCount 
> returns -1

Hi,

-1 from a SQLRowCount is entirly ok, it just means that the driver does not know how many rows are in the result set which is common with forward only cursors. Beyond that, I don't know what to suggest, I can only assume its a driver problem.

--
Nick
>
> -----Original Message-----
> From: Tony Esposito
> Sent: Sunday, September 16, 2012 8:23 PM
> To: nick at unixodbc.org
> Cc: Tony Esposito
> Subject: FW: [freetds] osql and isql -- how to test ODBC config?
> Importance: High
>
> Any help would be appreciated.  Is this address the main address the unixODBC.org?
>
> -----Original Message-----
> From: Tony Esposito
> Sent: Sunday, September 16, 2012 4:55 PM
> To: FreeTDS Development Group
> Cc: Tony Esposito
> Subject: RE: [freetds] osql and isql -- how to test ODBC config?
>
> More interesting stuff...
> Viewing Sybase Central, the Sybase DBA tool, shows that I have an active connection when I use isql.  In other words, I am making a successful connection to the database with the config I have but for some reason not returning rows (or not able to see table due to privs).  Yet 'help' can see the system catalog tables and return information about the tables I want to select from...
>
> -----Original Message-----
> From: Tony Esposito
> Sent: Sunday, September 16, 2012 3:20 PM
> To: FreeTDS Development Group
> Cc: Tony Esposito
> Subject: RE: [freetds] osql and isql -- how to test ODBC config?
>
> Thanks for the suggestions.  I unfortunately get no results from 'man bsqldb' or man bsqlodbc' from my Linux system.  Did you mean to refer to 'man' via the web instead?
>
> Did you happen to see my follow-up emails?  I can connect and access the system tables by virtue of the fact that the 'help' command works in 'isql' and returns the table description (see follow-up email I sent last night for an example of this).
> What I don't seem to be getting is access to database-specific tables.  The tool 'isql' shows no rows returned. (-1 rsow count).  I tried 'bsqlodbc' and it just hangs....
>
> I tried your reference to ASA database in the freetds.conf file and no change.
>
> Any help would be greatly appreciated.  I greatly appreciate the time you have already spent.  You are the best!
> '
>
> 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: Sunday, September 16, 2012 3:01 PM
> To: FreeTDS Development Group
> Subject: Re: [freetds] osql and isql -- how to test ODBC config?
>
> On Sun, 16 Sep 2012 03:55:16 +0000
>> I am not familiar with 'bsqldb'.
>> Can I just run it from bash shell prompt?
> I think you know the answer to that now, but for the record bsqldb is 
> documented as a man page.  "man bsqldb" is your friend.  :-)
>
> I misled you, though.  I meant to suggest you use bsqlodbc (similarly documented).  I hope it will do a better job of error reporting.
>
> Because you're using Sybase Anywhere I'll draw your attention to a footnote in the UG:
> http://www.freetds.org/userguide/freetdsconf.htm#FTN.AEN942.
>
> See also the "ASA database" in freetds.conf.  It might be something in that neighborhood.  I suspect so only because I see nothing wrong with your odbc.ini and because osql didn't report a problem.
>
>> Tried the following from the Linux shell prompt:
>>
>> 	bsqldb -S txeis -U dba -P sql
>>
>> And got the following error message:
>> bsqldb: Msg 20012, Level 2 Server name not found in configuration 
>> files
>>
>> bsqldb: Msg 20013, Level 2
>> Unknown host machine name
> Msg 20012 comes from FreeTDS.  It means FreeTDS couldn't convert the 
> provided name to an ip addreess.  The relevant part of the TDSDUMP is
>
>> dblib.c:7929:dbperror(0x1121510, 20013, 0)
>> dblib.c:7981:20013: "Unknown host machine name"
>> dblib.c:8002:"Unknown host machine name", client returns 2
>> (INT_CANCEL) util.c:361:tdserror: client library returned
>> TDS_INT_CANCEL(2) util.c:384:tdserror: returning TDS_INT_CANCEL(2) 
>> login.c:423:IP address pointer is empty login.c:425:Server txeis not 
>> found!
> What should the "provided name" be?  Outside ODBC, servers are known 
> to FreeTDS by their servername, a section name in freetds.conf.  Yours 
> is
> DB246111 because
>
>> [DB246111]
>> host = 207.235.236.120
>> port = 2638
>> tds version = 5.0
> so your command in bsqldb would be
>
> 	$ bsqldb -S DB246111 -U dba -P sql
>
> just as with tsql.
>
> Inside ODBC, it's too dark to read.  (Apologies to Groucho Marx.)
>
> In odbc.ini, the servername property names a freetds.conf servername, 
> and the utility (bsqlodbc or isql) is provided with the DSN name (Data 
> Source Name, not to be confused with DNS). Yours is txeis because
>
>> [txeis]
>> Driver=FreeTDS
>> Description=Sybase TXEIS Database
>> Servername=DB246111
>> Port=2638
>> TDS_Version=5.0
> so your command would be
>
> 	$ bsqlodbc -S txeis -U dba -P sql
>
> HTH.
>
> --jkl
> _______________________________________________
> FreeTDS mailing list
> FreeTDS at lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds
>
>
> -----
> No virus found in this message.
> Checked by AVG - www.avg.com
> Version: 2012.0.2221 / Virus Database: 2437/5271 - Release Date: 
> 09/16/12
>
> -----
> No virus found in this message.
> Checked by AVG - www.avg.com
> Version: 2012.0.2221 / Virus Database: 2437/5271 - Release Date: 
> 09/16/12
>
> -----
> No virus found in this message.
> Checked by AVG - www.avg.com
> Version: 2012.0.2221 / Virus Database: 2437/5271 - Release Date: 
> 09/16/12
>
> -----
> No virus found in this message.
> Checked by AVG - www.avg.com
> Version: 2012.0.2221 / Virus Database: 2437/5272 - Release Date: 
> 09/16/12
>
> _______________________________________________
> unixODBC-support mailing list
> unixODBC-support at mailman.unixodbc.org
> http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support

_______________________________________________
unixODBC-support mailing list
unixODBC-support at mailman.unixodbc.org
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support


-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2012.0.2221 / Virus Database: 2437/5273 - Release Date: 09/17/12



More information about the unixODBC-support mailing list