Menu

missing msql.query attribute

Petr Novak
2009-05-15
2013-04-29
  • Petr Novak

    Petr Novak - 2009-05-15

    Hello,

    I write little bit complex scripts that uses attribute query, but this attribute no longer exist. Is here any way how to make scripts like thisl like bellow make work again without rewriting it? Now i get this error:

    Traceback (most recent call last):
      File "./intranet_sql.py", line 7, in <module>
        if mssql.query(query):
    AttributeError: '_mssql.MssqlConnection' object has no attribute 'query'

    Thank you in advance.

    -------example code--------------

    #!/usr/bin/python
    import _mssql
    mssql=_mssql.connect('10.59.99.15','sa','');
    mssql.select_db('intranet')

    query="select * from zam;"
    if mssql.query(query):
        rows=mssql.fetch_array()
        numrow = rows[0][1]
        for row in rows:
            for i in range(numrow):
                file = row[2][i][0]
                print file
    else:
        print mssql.errmsg()
        print mssql.stdmsg()
    mssql.close();

    -------end----------

     
    • A

      A - 2009-05-15

      Sorry, I clearly stated that 1.0.0 is API breaking version. Only DB-API level is backwards compatible. If you REALLY must, just stick to pre-1.0.0. Althought this single change should be pretty easy to automatically replace using small perl/python script.

      Sorry for the inconvenience, new features are worth this small pain ;-)

       
    • Petr Novak

      Petr Novak - 2009-05-15

      Thank you for responding so quickly. I will switch to pre-1.0.0. for this case, because of time shortage, but next time I will use new API&features ;-)

       

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.