Re: unixodbc and character identifier limits?

"James K. Lowden" <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
Lukasz Szybalski wrote:
> ok I switched to 7.0 but while using pyodbc / ceodbc I get the
> following:
> 
> >>> connection =
> >ceODBC.Connection("DRIVER={TDS};Server=xxx;UID=xxx;PWD=xxx") >>
> >c=connection.cursor()
>  >>> c.execute('select xxxxxxx.HISTORY_NUMBER as
> xxxxxx_xxxxxx_HISTORY_NUMBER_38_THIS_IS_OVER_30 from
> xxxxxx').fetchone()
> 
> ('    7547',)
> >>> print c.description
> [('xxxxxx_xxxxx_HISTORY_NUMBER_38_TH', <type 'ceODBC.StringVar'>, 8,
> 8, 0, 0, False
> 
> As you can see the description is cut off?
> When I specify the DRIVER={TDS} is that going through
> /etc/freetds/freetds.conf ?

http://www.freetds.org/0.82/userguide/odbcconnattr.htm
http://www.freetds.org/0.82/userguide/dsnless.htm

No.  You're using "Server", not "Servername".  And I think you are using
DSN-less connection i.e., specifying all connection attributes in the
command string.  

To use TDS 7.0 in a DSN-less connection, your options are:

1.  Rebuild FreeTDS --with-tdsver=7.0, or
2.  Set the environment variable TDSVER=7.0 before starting Python, or
3.  Add "TDS_Version=7.0;" to your connection string.  
4.  Use "Servername" in your connection string.  

Any of those should work.  

> How could I replicate this in isql?

Please see app/bsqlodbc and its man page.  isql has some limitations that
can be misleading.  

HTH.  

--jkl
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.