From mbaiju at zeomega.net Mon Apr 6 13:29:50 2009 From: mbaiju at zeomega.net (Baiju M) Date: Mon Apr 6 19:29:55 2009 Subject: [egenix-users] Attribute error while using mx.ODBCConnect.Client.ServerSession Message-ID: Hi, I am getting an attribute error like this. Can anyone give me a pointer why this occur ? I am using 1.0.1 version of mxODBCConnect. >>> from mx.ODBCConnect.Client import ServerSession >>> ServerSession('connect-config.ini') Traceback (most recent call last): File "", line 1, in File "mx/ODBCConnect/Client/ServerSession.py", line 134, in __repr__ AttributeError: 'NoneType' object has no attribute 'connection' This is the config file: [Logging] log_file = client.log [Connection_Local] host = 192.168.2.205 port = 6632 using_ssl = 0 [Communication] server_connections = Connection_Local [Authentication] [Session] -- Baiju M From mbaiju at zeomega.net Mon Apr 6 16:16:29 2009 From: mbaiju at zeomega.net (Baiju M) Date: Mon Apr 6 22:16:37 2009 Subject: [egenix-users] Re: Attribute error while using mx.ODBCConnect.Client.ServerSession In-Reply-To: References: Message-ID: On Mon, Apr 6, 2009 at 12:29 PM, Baiju M wrote: > Hi, > > ? ?I am getting an attribute error like this. ?Can anyone > give me a pointer why this occur ? ?I am using 1.0.1 version > of mxODBCConnect. > >>>> from mx.ODBCConnect.Client import ServerSession >>>> ServerSession('connect-config.ini') > Traceback (most recent call last): > ?File "", line 1, in > ?File "mx/ODBCConnect/Client/ServerSession.py", line 134, in __repr__ > AttributeError: 'NoneType' object has no attribute 'connection' > > > This is the config file: > > [Logging] > log_file = client.log > > [Connection_Local] > > host = 192.168.2.205 > port = 6632 > using_ssl = 0 > > [Communication] > server_connections = Connection_Local > > [Authentication] > [Session] This happens when I try from command line, it worked for me when I typed it in one file and ran. Regards, Baiju M From mal at egenix.com Tue Apr 7 11:39:34 2009 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Apr 7 10:39:38 2009 Subject: [egenix-users] Re: Attribute error while using mx.ODBCConnect.Client.ServerSession In-Reply-To: References: Message-ID: <49DB1146.2070502@egenix.com> On 2009-04-06 22:16, Baiju M wrote: > On Mon, Apr 6, 2009 at 12:29 PM, Baiju M wrote: >> Hi, >> >> I am getting an attribute error like this. Can anyone >> give me a pointer why this occur ? I am using 1.0.1 version >> of mxODBCConnect. >> >>>>> from mx.ODBCConnect.Client import ServerSession >>>>> ServerSession('connect-config.ini') >> Traceback (most recent call last): >> File "", line 1, in >> File "mx/ODBCConnect/Client/ServerSession.py", line 134, in __repr__ >> AttributeError: 'NoneType' object has no attribute 'connection' >> >> >> This is the config file: >> >> [Logging] >> log_file = client.log >> >> [Connection_Local] >> >> host = 192.168.2.205 >> port = 6632 >> using_ssl = 0 >> >> [Communication] >> server_connections = Connection_Local >> >> [Authentication] >> [Session] > > This happens when I try from command line, it worked > for me when I typed it in one file and ran. Thanks for the report. repr() tries to open connection and this fails if the connection to the server has not been opened yet. We'll fix this in mxODBC Connect 1.0.2. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Apr 07 2009) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ 2009-03-19: Released mxODBC.Connect 1.0.1 http://python.egenix.com/ ::: Try our new mxODBC.Connect Python Database Interface for free ! :::: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 http://www.egenix.com/company/contact/ From nicogrubert at gmail.com Wed Apr 15 17:37:10 2009 From: nicogrubert at gmail.com (Nico Grubert) Date: Wed Apr 15 16:37:19 2009 Subject: [egenix-users] ODBCConnect: ImportError: No module named UID Message-ID: <49E5F116.4060902@gmail.com> Hi there /src I have installed the new "mxODBCConnect" client package ("egenix-mxodbc-connect-client-1.0.1.py2.4.prebuilt"). My system: Suse Linux 10.2, 64 Bit, Python 2.4.4 After I have installed the package, I try to import the package with: >>> import mx.ODBCConnect.Client This throws out the error: Traceback (most recent call last): File "", line 1, in ? File "/usr/local/lib/python2.4/site-packages/PIL/__init__.py", line 18, in ? File "mx/ODBCConnect/Client/ServerSession.py", line 15, in ? File "mx/ODBCConnect/Common/Transport.py", line 12, in ? ImportError: No module named UID Here is the ouput of the install process: mymachine:/var/tmp/egenix-mxodbc-connect-client-1.0.1.py2.4.prebuilt # python setup.py install running install found usable build data file 'build/build-py2.4.pck' skipping the build process and reusing the existing build files and data setting platform to 'linux-i686' adjusting distutils platform string to 'linux-i686' restoring build data from a previous build run running build running install_lib creating /usr/local/lib/python2.4/site-packages/mx/ODBCConnect creating /usr/local/lib/python2.4/site-packages/mx/ODBCConnect/Doc copying build/lib.2.4/mx/ODBCConnect/Doc/eGenix.com-Third-Party-Licenses-1.0.pdf -> /usr/local/lib/python2.4/site-packages/mx/ODBCConnect/Doc copying build/lib.2.4/mx/ODBCConnect/Doc/client-config.ini -> /usr/local/lib/python2.4/site-packages/mx/ODBCConnect/Doc copying build/lib.2.4/mx/ODBCConnect/Doc/mxODBCConnect.pdf -> /usr/local/lib/python2.4/site-packages/mx/ODBCConnect/Doc copying build/lib.2.4/mx/ODBCConnect/Doc/mxODBC.pdf -> /usr/local/lib/python2.4/site-packages/mx/ODBCConnect/Doc creating /usr/local/lib/python2.4/site-packages/mx/ODBCConnect/Misc copying build/lib.2.4/mx/ODBCConnect/Misc/Helpers.pyc -> /usr/local/lib/python2.4/site-packages/mx/ODBCConnect/Misc copying build/lib.2.4/mx/ODBCConnect/Misc/Helpers.pyo -> /usr/local/lib/python2.4/site-packages/mx/ODBCConnect/Misc copying build/lib.2.4/mx/ODBCConnect/Misc/test.pyc -> /usr/local/lib/python2.4/site-packages/mx/ODBCConnect/Misc copying build/lib.2.4/mx/ODBCConnect/Misc/test.pyo -> /usr/local/lib/python2.4/site-packages/mx/ODBCConnect/Misc copying build/lib.2.4/mx/ODBCConnect/Misc/__init__.pyc -> /usr/local/lib/python2.4/site-packages/mx/ODBCConnect/Misc copying build/lib.2.4/mx/ODBCConnect/Misc/__init__.pyo -> /usr/local/lib/python2.4/site-packages/mx/ODBCConnect/Misc copying build/lib.2.4/mx/ODBCConnect/Misc/proc.pyc -> /usr/local/lib/python2.4/site-packages/mx/ODBCConnect/Misc copying build/lib.2.4/mx/ODBCConnect/Misc/proc.pyo -> /usr/local/lib/python2.4/site-packages/mx/ODBCConnect/Misc creating /usr/local/lib/python2.4/site-packages/mx/ODBCConnect/Client copying build/lib.2.4/mx/ODBCConnect/Client/ClientConfig.pyc -> /usr/local/lib/python2.4/site-packages/mx/ODBCConnect/Client copying build/lib.2.4/mx/ODBCConnect/Client/ClientConfig.pyo -> /usr/local/lib/python2.4/site-packages/mx/ODBCConnect/Client copying build/lib.2.4/mx/ODBCConnect/Client/ServerSession.pyc -> /usr/local/lib/python2.4/site-packages/mx/ODBCConnect/Client copying build/lib.2.4/mx/ODBCConnect/Client/ServerSession.pyo -> /usr/local/lib/python2.4/site-packages/mx/ODBCConnect/Client copying build/lib.2.4/mx/ODBCConnect/Client/__init__.pyc -> /usr/local/lib/python2.4/site-packages/mx/ODBCConnect/Client copying build/lib.2.4/mx/ODBCConnect/Client/__init__.pyo -> /usr/local/lib/python2.4/site-packages/mx/ODBCConnect/Client creating /usr/local/lib/python2.4/site-packages/mx/ODBCConnect/Common copying build/lib.2.4/mx/ODBCConnect/Common/TCPConnection.pyc -> /usr/local/lib/python2.4/site-packages/mx/ODBCConnect/Common copying build/lib.2.4/mx/ODBCConnect/Common/TCPConnection.pyo -> /usr/local/lib/python2.4/site-packages/mx/ODBCConnect/Common copying build/lib.2.4/mx/ODBCConnect/Common/mxODBCreference.pyc -> /usr/local/lib/python2.4/site-packages/mx/ODBCConnect/Common copying build/lib.2.4/mx/ODBCConnect/Common/mxODBCreference.pyo -> /usr/local/lib/python2.4/site-packages/mx/ODBCConnect/Common copying build/lib.2.4/mx/ODBCConnect/Common/ProxyObjects.pyc -> /usr/local/lib/python2.4/site-packages/mx/ODBCConnect/Common copying build/lib.2.4/mx/ODBCConnect/Common/ProxyObjects.pyo -> /usr/local/lib/python2.4/site-packages/mx/ODBCConnect/Common copying build/lib.2.4/mx/ODBCConnect/Common/SSLModule.pyc -> /usr/local/lib/python2.4/site-packages/mx/ODBCConnect/Common copying build/lib.2.4/mx/ODBCConnect/Common/SSLModule.pyo -> /usr/local/lib/python2.4/site-packages/mx/ODBCConnect/Common copying build/lib.2.4/mx/ODBCConnect/Common/Transport.pyc -> /usr/local/lib/python2.4/site-packages/mx/ODBCConnect/Common copying build/lib.2.4/mx/ODBCConnect/Common/Transport.pyo -> /usr/local/lib/python2.4/site-packages/mx/ODBCConnect/Common copying build/lib.2.4/mx/ODBCConnect/Common/CacheScheme.pyc -> /usr/local/lib/python2.4/site-packages/mx/ODBCConnect/Common copying build/lib.2.4/mx/ODBCConnect/Common/CacheScheme.pyo -> /usr/local/lib/python2.4/site-packages/mx/ODBCConnect/Common copying build/lib.2.4/mx/ODBCConnect/Common/__init__.pyc -> /usr/local/lib/python2.4/site-packages/mx/ODBCConnect/Common copying build/lib.2.4/mx/ODBCConnect/Common/__init__.pyo -> /usr/local/lib/python2.4/site-packages/mx/ODBCConnect/Common copying build/lib.2.4/mx/ODBCConnect/Common/Tools.pyc -> /usr/local/lib/python2.4/site-packages/mx/ODBCConnect/Common copying build/lib.2.4/mx/ODBCConnect/Common/Tools.pyo -> /usr/local/lib/python2.4/site-packages/mx/ODBCConnect/Common copying build/lib.2.4/mx/ODBCConnect/Common/CA.pyc -> /usr/local/lib/python2.4/site-packages/mx/ODBCConnect/Common copying build/lib.2.4/mx/ODBCConnect/Common/CA.pyo -> /usr/local/lib/python2.4/site-packages/mx/ODBCConnect/Common copying build/lib.2.4/mx/ODBCConnect/LICENSE -> /usr/local/lib/python2.4/site-packages/mx/ODBCConnect copying build/lib.2.4/mx/ODBCConnect/README -> /usr/local/lib/python2.4/site-packages/mx/ODBCConnect copying build/lib.2.4/mx/ODBCConnect/Error.pyc -> /usr/local/lib/python2.4/site-packages/mx/ODBCConnect copying build/lib.2.4/mx/ODBCConnect/Error.pyo -> /usr/local/lib/python2.4/site-packages/mx/ODBCConnect copying build/lib.2.4/mx/ODBCConnect/__init__.pyc -> /usr/local/lib/python2.4/site-packages/mx/ODBCConnect copying build/lib.2.4/mx/ODBCConnect/__init__.pyo -> /usr/local/lib/python2.4/site-packages/mx/ODBCConnect copying build/lib.2.4/mx/ODBCConnect/COPYRIGHT -> /usr/local/lib/python2.4/site-packages/mx/ODBCConnect writing byte-compilation script '/tmp/tmp7WjiVX.py' /usr/local/bin/python -O /tmp/tmp7WjiVX.py removing /tmp/tmp7WjiVX.py running install_data Did I miss something? Thanks in advance. Nico From mal at egenix.com Wed Apr 15 18:52:56 2009 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Apr 15 17:53:00 2009 Subject: [egenix-users] ODBCConnect: ImportError: No module named UID In-Reply-To: <49E5F116.4060902@gmail.com> References: <49E5F116.4060902@gmail.com> Message-ID: <49E602D8.1070601@egenix.com> On 2009-04-15 16:37, Nico Grubert wrote: > Hi there > /src > I have installed the new "mxODBCConnect" client package > ("egenix-mxodbc-connect-client-1.0.1.py2.4.prebuilt"). > My system: Suse Linux 10.2, 64 Bit, Python 2.4.4 > > After I have installed the package, I try to import the package with: > >>>> import mx.ODBCConnect.Client > > This throws out the error: > > Traceback (most recent call last): > File "", line 1, in ? > File "/usr/local/lib/python2.4/site-packages/PIL/__init__.py", line > 18, in ? > > File "mx/ODBCConnect/Client/ServerSession.py", line 15, in ? > File "mx/ODBCConnect/Common/Transport.py", line 12, in ? > ImportError: No module named UID Please install egenix-mx-base before installing the egenix-mxodbc-connect-client. mx.UID is part of the base package. > Did I miss something? Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Apr 15 2009) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ 2009-03-19: Released mxODBC.Connect 1.0.1 http://python.egenix.com/ ::: Try our new mxODBC.Connect Python Database Interface for free ! :::: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 http://www.egenix.com/company/contact/ From nicogrubert at gmail.com Thu Apr 16 08:30:28 2009 From: nicogrubert at gmail.com (Nico Grubert) Date: Thu Apr 16 07:30:31 2009 Subject: [egenix-users] ODBCConnect: ImportError: No module named UID In-Reply-To: <49E602D8.1070601@egenix.com> References: <49E5F116.4060902@gmail.com> <49E602D8.1070601@egenix.com> Message-ID: <49E6C274.9040903@gmail.com> >> File "mx/ODBCConnect/Client/ServerSession.py", line 15, in ? >> File "mx/ODBCConnect/Common/Transport.py", line 12, in ? >> ImportError: No module named UID > > Please install egenix-mx-base before installing the egenix-mxodbc-connect-client. > > mx.UID is part of the base package. Hi Mark-Andr? Thank you for your fast reply. I thought, the egenix-mx-base package is already installed because importing mx.DateTime worked fine. >>> from mx.DateTime import now >>> now() But maybe the installed mx-base package is just too old? >>> import mx >>> mx.__version__ '2.0' Regards Nico From mal at egenix.com Thu Apr 16 11:40:23 2009 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Apr 16 10:40:28 2009 Subject: [egenix-users] ODBCConnect: ImportError: No module named UID In-Reply-To: <49E6C274.9040903@gmail.com> References: <49E5F116.4060902@gmail.com> <49E602D8.1070601@egenix.com> <49E6C274.9040903@gmail.com> Message-ID: <49E6EEF7.3050302@egenix.com> On 2009-04-16 07:30, Nico Grubert wrote: > >>> File "mx/ODBCConnect/Client/ServerSession.py", line 15, in ? >>> File "mx/ODBCConnect/Common/Transport.py", line 12, in ? >>> ImportError: No module named UID >> >> Please install egenix-mx-base before installing the >> egenix-mxodbc-connect-client. >> >> mx.UID is part of the base package. > > Hi Mark-Andr? > > Thank you for your fast reply. > I thought, the egenix-mx-base package is already installed because > importing mx.DateTime worked fine. > >>>> from mx.DateTime import now >>>> now() > > > But maybe the installed mx-base package is just too old? >>>> import mx >>>> mx.__version__ > '2.0' Indeed. mxUID is included in egenix-mx-base 3.0 and later. The current version is 3.1.2... http://www.egenix.com/products/python/mxBase/ Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Apr 16 2009) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ 2009-03-19: Released mxODBC.Connect 1.0.1 http://python.egenix.com/ ::: Try our new mxODBC.Connect Python Database Interface for free ! :::: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 http://www.egenix.com/company/contact/ From a.km.mail at gmail.com Mon Apr 20 19:56:21 2009 From: a.km.mail at gmail.com (akm) Date: Mon Apr 20 15:26:30 2009 Subject: [egenix-users] unixODBC SQLSEVER OUPUT issue In-Reply-To: References: Message-ID: <9f7242b30904200626qa8e48e9gd60c68a0aff7ef@mail.gmail.com> 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 From mal at egenix.com Mon Apr 20 17:57:24 2009 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Apr 20 16:57:28 2009 Subject: [egenix-users] unixODBC SQLSEVER OUPUT issue In-Reply-To: <9f7242b30904200626qa8e48e9gd60c68a0aff7ef@mail.gmail.com> References: <9f7242b30904200626qa8e48e9gd60c68a0aff7ef@mail.gmail.com> Message-ID: <49EC8D54.4000609@egenix.com> On 2009-04-20 15:26, akm wrote: > 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 ? It's possible that MS SQL Server puts the output into a separate result set. You can use cursor.nextset() to jump to the next available result set. > #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 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > https://www.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Apr 20 2009) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try our new mxODBC.Connect Python Database Interface for free ! :::: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 http://www.egenix.com/company/contact/ From a.km.mail at gmail.com Tue Apr 21 17:27:52 2009 From: a.km.mail at gmail.com (akm) Date: Tue Apr 21 12:57:58 2009 Subject: [egenix-users] unixODBC SQLSEVER OUPUT issue In-Reply-To: <49EC8D54.4000609@egenix.com> References: <9f7242b30904200626qa8e48e9gd60c68a0aff7ef@mail.gmail.com> <49EC8D54.4000609@egenix.com> Message-ID: <9f7242b30904210357t722f06b2m7685a8f87f3a3a@mail.gmail.com> Hi, I am getting the result when i change the parameter style to '%' from '?'. Any idea how to fix this ? >>> from mx.ODBC import unixODBC >>> db = unixODBC.DriverConnect('dsn=mydsn;uid=user;pwd=passwd', clear_auto_commit = 1) >>> conn = db.cursor() >>> query_insert1 = """INSERT INTO [table_name] ... ( ... [description], ... [condition], ... [units], ... [entity_active], ... [crt_dt], ... [upd_dt], ... [user_idn]) ... OUTPUT INSERTED.* ... VALUES( ... '%s', ... NULL, ... NULL, ... '%s', ... NULL, ... NULL, ... NULL)""" >>> data = ('ERS', 'Y') >>> conn.execute(query_insert1% data) >>> print conn.fetchone() (237.0, 'ERS', None, None, 'Y', None, None, None) >>> conn.execute(query_insert1, data) >>> print conn.fetchone() None >>> query_insert2 = """INSERT INTO [table_name] ... ( ... [description], ... [condition], ... [units], ... [entity_active], ... [crt_dt], ... [upd_dt], ... [user_idn]) ... OUTPUT INSERTED.* ... VALUES( ... ?, ... NULL, ... NULL, ... ?, ... NULL, ... NULL, ... NULL)""" >>> conn.execute(query_insert2, data) >>> print conn.fetchone() Traceback (most recent call last): File "", line 1, in mx.ODBC.Error.ProgrammingError: missing result set On Mon, Apr 20, 2009 at 8:27 PM, M.-A. Lemburg wrote: > On 2009-04-20 15:26, akm wrote: >> 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 ? > > It's possible that MS SQL Server puts the output into a separate > result set. > > You can use cursor.nextset() to jump to the next available result > set. > >> #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 >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List ? ? ? ? ? ? ? ? ? ? http://www.egenix.com/ >> https://www.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source ?(#1, Apr 20 2009) >>>> Python/Zope Consulting and Support ... ? ? ? ?http://www.egenix.com/ >>>> mxODBC.Zope.Database.Adapter ... ? ? ? ? ? ? http://zope.egenix.com/ >>>> mxODBC, mxDateTime, mxTextTools ... ? ? ? ?http://python.egenix.com/ > ________________________________________________________________________ > > ::: Try our new mxODBC.Connect Python Database Interface for free ! :::: > > > ? eGenix.com Software, Skills and Services GmbH ?Pastor-Loeh-Str.48 > ? ?D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg > ? ? ? ? ? Registered at Amtsgericht Duesseldorf: HRB 46611 > ? ? ? ? ? ? ? http://www.egenix.com/company/contact/ > From charlie at egenix.com Tue Apr 21 14:20:46 2009 From: charlie at egenix.com (Charlie Clark) Date: Tue Apr 21 13:20:53 2009 Subject: [egenix-users] unixODBC SQLSEVER OUPUT issue In-Reply-To: <9f7242b30904210357t722f06b2m7685a8f87f3a3a@mail.gmail.com> References: <9f7242b30904200626qa8e48e9gd60c68a0aff7ef@mail.gmail.com> <49EC8D54.4000609@egenix.com> <9f7242b30904210357t722f06b2m7685a8f87f3a3a@mail.gmail.com> Message-ID: Am 21.04.2009, 12:57 Uhr, schrieb akm : >>>> conn.execute(query_insert2, data) >>>> print conn.fetchone() > Traceback (most recent call last): > File "", line 1, in > mx.ODBC.Error.ProgrammingError: missing result set It's an insert statement. Why should it have any results? Charlie -- Charlie Clark eGenix.com Professional Python Services directly from the Source >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try our new mxODBC.Connect Python Database Interface for free ! :::: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 http://www.egenix.com/company/contact/ From a.km.mail at gmail.com Tue Apr 21 18:10:41 2009 From: a.km.mail at gmail.com (akm) Date: Tue Apr 21 13:40:49 2009 Subject: [egenix-users] unixODBC SQLSEVER OUPUT issue In-Reply-To: References: <9f7242b30904200626qa8e48e9gd60c68a0aff7ef@mail.gmail.com> <49EC8D54.4000609@egenix.com> <9f7242b30904210357t722f06b2m7685a8f87f3a3a@mail.gmail.com> Message-ID: <9f7242b30904210440l48073295r438ebf232b5b965f@mail.gmail.com> On Tue, Apr 21, 2009 at 4:50 PM, Charlie Clark wrote: > Am 21.04.2009, 12:57 Uhr, schrieb akm : > >>>>> conn.execute(query_insert2, data) >>>>> print conn.fetchone() >> Traceback (most recent call last): >> ?File "", line 1, in >> mx.ODBC.Error.ProgrammingError: missing result set > > It's an insert statement. Why should it have any results? OUTPUT is A SQL Server 2005 feature that helps in returning the actual data from a table soon after an insert. Applications require return values such as the new identity value, the computed column value or the default value generated by the default constraint. > > Charlie > -- > Charlie Clark > eGenix.com > > Professional Python Services directly from the Source >>>> Python/Zope Consulting and Support ... ? ? ? ?http://www.egenix.com/ >>>> mxODBC.Zope.Database.Adapter ... ? ? ? ? ? ? http://zope.egenix.com/ >>>> mxODBC, mxDateTime, mxTextTools ... ? ? ? ?http://python.egenix.com/ > ________________________________________________________________________ > > ::: Try our new mxODBC.Connect Python Database Interface for free ! :::: > > > ? eGenix.com Software, Skills and Services GmbH ?Pastor-Loeh-Str.48 > ? ?D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg > ? ? ? ? ? Registered at Amtsgericht Duesseldorf: HRB 46611 > ? ? ? ? ? ? ? http://www.egenix.com/company/contact/ >