[egenix-users] unixODBC SQLSEVER OUPUT issue

akm a.km.mail at gmail.com
Mon Apr 20 19:56:21 CEST 2009


Hi  All,

The query given below is supposed to return all columns from the table
'table_name'  for the record with user '111'.
I am not getting any result from linux while excuting fetchone() , but
it works fine in windows.

Can anyone give me a pointer why this occurs ?

#test.py
query = """update table_name
                          set upd_dt = getdate(),
                          user =222,
                OUPUT INSERTED.*
                      where user =  111,
               """

def connectToDataBase(connstr):
    if sys.platform == 'win32':
        from mx.ODBC import Windows
    db = Windows.DriverConnect(connstr, clear_auto_commit = 1)
        conn = db.cursor()
    else:
        from mx.ODBC import unixODBC
        db = unixODBC.DriverConnect(connstr, clear_auto_commit = 1)
        conn = db.cursor()
    conn.execute(result)
    print conn.fetchone()

if __name__ == '__main__':
    print connectToDataBase('dsn=sb;uid=user;pwd=passwd')


Thanks,
Abdul Kader M



More information about the egenix-users mailing list