Menu

Can't select, but can do everything else! :)

2009-12-03
2013-04-29
  • Adam Summers

    Adam Summers - 2009-12-03

    Hi there,

    I'm using pymssql-1.0.2-py2.5.egg-info on linux, but I can't do a basic select…

    for example:

        import pymssql
       
        con = pymssql.connect(host=r'10.195.20.43:1433', user='xxx', password='pw', database='xxx')
        cur = con.cursor()
        cur.execute('select 1;')
        print cur.description, " <- description"
        print cur.fetchall()

    returns:

        $ python2.5 test4.py
         (('', 3, None, None, None, None, None),)  <- description
        

    the freetds log is available at http://files.me.com/adamsummers1/c4ku09

    If I do a "create table", it will succeed. It seems that I'm having problems only seeing the data returned…

    It should be noted, if I use tsql, I can do this select.

    Any help is much appreciated

     
  • Anonymous

    Anonymous - 2009-12-03

    Works for me…
    <pre>
    www4:~$ python
    Python 2.5 (r25:51908, Mar 16 2007, 19:36:04)
    on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import pymssql
    >>> cn = pymssql.connect(host='x.x.x.x:1433', user='user', password='password')
    >>> c = cn.cursor()
    >>> c.execute('select 1')
    >>> c.fetchall()

    >>> c.execute('select 1')
    >>> c.description

    >>> c.fetchall()

    >>> c.execute('select 1;')
    >>> c.description

    >>> c.fetchall()

    >>>
    </pre>

     
  • Adam Summers

    Adam Summers - 2009-12-04

    Hi,

    Thanks for the confirmation. I now have it working, I probably made two mistakes:

    1) I was using the dev version of freetds, not the current stable version (0.82).

    2) My python was configured with -prefix=/home/adam/vlh ; but I didn't have /home/adam/vlh/lib in my LD_LIBRARY_PATH

    Regards,
    Adam

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.