From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Jan 13 11:13:17 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 13 11:13:17 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Jan 13 11:13:17 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Fri Jan 13 11:13:17 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 13 11:13:17 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Fri Jan 13 11:13:17 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Fri Jan 13 11:13:17 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 13 11:13:17 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Fri Jan 13 11:13:17 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 13 11:13:17 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Fri Jan 13 11:13:17 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Fri Jan 13 11:13:17 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 13 11:13:17 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Jan 13 11:13:17 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 13 11:13:17 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Fri Jan 13 11:13:17 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 13 11:13:17 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Fri Jan 13 11:13:17 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Jan 13 15:13:49 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 13 15:13:49 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Jan 13 15:13:49 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Fri Jan 13 15:13:49 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 13 15:13:49 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Fri Jan 13 15:13:49 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Fri Jan 13 15:13:49 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 13 15:13:49 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Fri Jan 13 15:13:49 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 13 15:13:49 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Fri Jan 13 15:13:50 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0001.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Fri Jan 13 15:13:50 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0001.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 13 15:13:50 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Jan 13 15:13:50 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 13 15:13:50 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Fri Jan 13 15:13:50 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 13 15:13:50 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Fri Jan 13 15:13:50 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Jan 13 15:21:12 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 13 15:21:12 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Jan 13 15:21:12 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Fri Jan 13 15:21:12 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 13 15:21:12 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Fri Jan 13 15:21:12 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Fri Jan 13 15:21:12 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 13 15:21:12 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Fri Jan 13 15:21:12 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 13 15:21:12 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Fri Jan 13 15:21:12 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0002.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Fri Jan 13 15:21:12 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0002.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 13 15:21:12 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Jan 13 15:21:12 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 13 15:21:12 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Fri Jan 13 15:21:12 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 13 15:21:12 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Fri Jan 13 15:21:12 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Jan 13 16:00:44 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 13 16:00:44 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Jan 13 16:00:44 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Fri Jan 13 16:00:44 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 13 16:00:44 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Fri Jan 13 16:00:44 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Fri Jan 13 16:00:44 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 13 16:00:44 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Fri Jan 13 16:00:44 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 13 16:00:44 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Fri Jan 13 16:00:44 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0003.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Fri Jan 13 16:00:44 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0003.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 13 16:00:44 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Jan 13 16:00:44 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 13 16:00:44 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Fri Jan 13 16:00:44 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 13 16:00:44 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Fri Jan 13 16:00:44 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Jan 13 20:01:28 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 13 20:01:29 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Jan 13 20:01:29 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Fri Jan 13 20:01:29 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 13 20:01:29 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Fri Jan 13 20:01:29 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Fri Jan 13 20:01:29 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 13 20:01:29 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Fri Jan 13 20:01:29 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 13 20:01:29 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Fri Jan 13 20:01:29 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0004.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Fri Jan 13 20:01:29 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0004.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 13 20:01:29 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Jan 13 20:01:29 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 13 20:01:29 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Fri Jan 13 20:01:29 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 13 20:01:29 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Fri Jan 13 20:01:30 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Jan 14 08:02:12 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 14 08:02:12 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Jan 14 08:02:12 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Sat Jan 14 08:02:12 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 14 08:02:12 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Sat Jan 14 08:02:12 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Sat Jan 14 08:02:12 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 14 08:02:12 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Sat Jan 14 08:02:12 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 14 08:02:12 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Sat Jan 14 08:02:12 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0005.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Sat Jan 14 08:02:12 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0005.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 14 08:02:12 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Jan 14 08:02:12 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 14 08:02:12 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sat Jan 14 08:02:12 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 14 08:02:12 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sat Jan 14 08:02:12 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Jan 14 12:00:41 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 14 12:00:41 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Jan 14 12:00:41 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Sat Jan 14 12:00:41 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 14 12:00:41 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Sat Jan 14 12:00:41 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Sat Jan 14 12:00:41 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 14 12:00:41 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Sat Jan 14 12:00:41 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 14 12:00:41 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Sat Jan 14 12:00:41 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0006.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Sat Jan 14 12:00:41 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0006.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 14 12:00:41 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Jan 14 12:00:41 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 14 12:00:41 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sat Jan 14 12:00:41 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 14 12:00:41 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sat Jan 14 12:00:41 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Jan 14 16:00:40 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 14 16:00:41 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Jan 14 16:00:41 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Sat Jan 14 16:00:41 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 14 16:00:41 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Sat Jan 14 16:00:41 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Sat Jan 14 16:00:41 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 14 16:00:41 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Sat Jan 14 16:00:41 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 14 16:00:41 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Sat Jan 14 16:00:41 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0007.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Sat Jan 14 16:00:41 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0007.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 14 16:00:41 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Jan 14 16:00:41 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 14 16:00:41 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sat Jan 14 16:00:41 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 14 16:00:41 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sat Jan 14 16:00:41 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Jan 14 20:00:36 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 14 20:00:36 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Jan 14 20:00:36 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Sat Jan 14 20:00:36 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 14 20:00:36 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Sat Jan 14 20:00:36 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Sat Jan 14 20:00:36 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 14 20:00:36 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Sat Jan 14 20:00:36 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 14 20:00:36 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Sat Jan 14 20:00:36 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0008.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Sat Jan 14 20:00:37 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0008.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 14 20:00:37 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Jan 14 20:00:37 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 14 20:00:37 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sat Jan 14 20:00:37 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 14 20:00:37 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sat Jan 14 20:00:37 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Jan 15 08:01:57 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 15 08:01:57 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Jan 15 08:01:57 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Sun Jan 15 08:01:57 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 15 08:01:57 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Sun Jan 15 08:01:57 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Sun Jan 15 08:01:57 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 15 08:01:57 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Sun Jan 15 08:01:57 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 15 08:01:58 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Sun Jan 15 08:02:01 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0009.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Sun Jan 15 08:02:01 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0009.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 15 08:02:01 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Jan 15 08:02:01 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 15 08:02:01 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sun Jan 15 08:02:01 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 15 08:02:01 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sun Jan 15 08:02:01 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Jan 15 12:00:47 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 15 12:00:47 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Jan 15 12:00:47 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Sun Jan 15 12:00:47 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 15 12:00:47 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Sun Jan 15 12:00:47 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Sun Jan 15 12:00:47 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 15 12:00:47 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Sun Jan 15 12:00:47 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 15 12:00:47 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Sun Jan 15 12:00:47 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0010.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Sun Jan 15 12:00:47 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0010.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 15 12:00:47 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Jan 15 12:00:47 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 15 12:00:47 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sun Jan 15 12:00:47 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 15 12:00:47 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sun Jan 15 12:00:47 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Jan 15 16:00:40 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 15 16:00:40 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Jan 15 16:00:40 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Sun Jan 15 16:00:40 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 15 16:00:40 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Sun Jan 15 16:00:40 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Sun Jan 15 16:00:40 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 15 16:00:40 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Sun Jan 15 16:00:40 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 15 16:00:40 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Sun Jan 15 16:00:40 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0011.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Sun Jan 15 16:00:40 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0011.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 15 16:00:40 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Jan 15 16:00:40 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 15 16:00:40 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sun Jan 15 16:00:40 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 15 16:00:40 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sun Jan 15 16:00:41 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Jan 15 20:00:37 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 15 20:00:37 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Jan 15 20:00:37 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Sun Jan 15 20:00:37 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 15 20:00:37 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Sun Jan 15 20:00:37 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Sun Jan 15 20:00:37 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 15 20:00:37 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Sun Jan 15 20:00:37 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 15 20:00:37 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Sun Jan 15 20:00:37 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0012.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Sun Jan 15 20:00:37 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0012.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 15 20:00:37 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Jan 15 20:00:37 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 15 20:00:37 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sun Jan 15 20:00:37 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 15 20:00:37 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sun Jan 15 20:00:37 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Jan 16 08:02:25 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 16 08:02:25 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Jan 16 08:02:25 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Mon Jan 16 08:02:25 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 16 08:02:25 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Mon Jan 16 08:02:25 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Mon Jan 16 08:02:25 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 16 08:02:25 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Mon Jan 16 08:02:25 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 16 08:02:25 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Mon Jan 16 08:02:25 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0013.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Mon Jan 16 08:02:25 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0013.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 16 08:02:25 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Jan 16 08:02:25 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 16 08:02:25 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Mon Jan 16 08:02:25 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 16 08:02:25 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Mon Jan 16 08:02:25 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Jan 16 12:00:43 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 16 12:00:44 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Jan 16 12:00:44 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Mon Jan 16 12:00:44 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 16 12:00:44 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Mon Jan 16 12:00:44 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Mon Jan 16 12:00:44 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 16 12:00:44 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Mon Jan 16 12:00:44 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 16 12:00:44 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Mon Jan 16 12:00:44 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0014.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Mon Jan 16 12:00:44 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0014.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 16 12:00:44 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Jan 16 12:00:44 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 16 12:00:44 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Mon Jan 16 12:00:44 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 16 12:00:44 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Mon Jan 16 12:00:45 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Jan 16 16:00:42 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 16 16:00:42 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Jan 16 16:00:42 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Mon Jan 16 16:00:42 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 16 16:00:42 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Mon Jan 16 16:00:42 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Mon Jan 16 16:00:42 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 16 16:00:42 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Mon Jan 16 16:00:42 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 16 16:00:42 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Mon Jan 16 16:00:42 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0015.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Mon Jan 16 16:00:42 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0015.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 16 16:00:42 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Jan 16 16:00:42 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 16 16:00:42 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Mon Jan 16 16:00:42 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 16 16:00:42 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Mon Jan 16 16:00:42 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Jan 16 20:00:36 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 16 20:00:36 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Jan 16 20:00:36 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Mon Jan 16 20:00:36 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 16 20:00:36 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Mon Jan 16 20:00:36 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Mon Jan 16 20:00:36 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 16 20:00:36 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Mon Jan 16 20:00:36 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 16 20:00:36 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Mon Jan 16 20:00:36 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0016.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Mon Jan 16 20:00:36 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0016.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 16 20:00:36 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Jan 16 20:00:36 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 16 20:00:36 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Mon Jan 16 20:00:36 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 16 20:00:36 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Mon Jan 16 20:00:36 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Jan 17 08:02:25 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 17 08:02:25 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Jan 17 08:02:25 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Tue Jan 17 08:02:25 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 17 08:02:25 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Tue Jan 17 08:02:25 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Tue Jan 17 08:02:25 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 17 08:02:26 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Tue Jan 17 08:02:26 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 17 08:02:26 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Tue Jan 17 08:02:26 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0017.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Tue Jan 17 08:02:26 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0017.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 17 08:02:26 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Jan 17 08:02:26 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 17 08:02:26 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Tue Jan 17 08:02:26 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 17 08:02:26 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Tue Jan 17 08:02:26 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Jan 17 12:00:53 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 17 12:00:53 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Jan 17 12:00:53 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Tue Jan 17 12:00:53 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 17 12:00:53 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Tue Jan 17 12:00:53 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Tue Jan 17 12:00:53 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 17 12:00:54 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Tue Jan 17 12:00:54 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 17 12:00:54 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Tue Jan 17 12:00:54 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0018.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Tue Jan 17 12:00:54 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0018.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 17 12:00:54 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Jan 17 12:00:54 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 17 12:00:54 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Tue Jan 17 12:00:54 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 17 12:00:54 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Tue Jan 17 12:00:54 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Jan 17 16:00:45 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 17 16:00:45 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Jan 17 16:00:45 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Tue Jan 17 16:00:45 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 17 16:00:45 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Tue Jan 17 16:00:45 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Tue Jan 17 16:00:45 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 17 16:00:45 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Tue Jan 17 16:00:45 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 17 16:00:45 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Tue Jan 17 16:00:45 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0019.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Tue Jan 17 16:00:45 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0019.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 17 16:00:45 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Jan 17 16:00:45 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 17 16:00:45 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Tue Jan 17 16:00:45 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 17 16:00:45 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Tue Jan 17 16:00:45 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Jan 17 20:00:45 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 17 20:00:45 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Jan 17 20:00:45 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Tue Jan 17 20:00:45 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 17 20:00:45 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Tue Jan 17 20:00:45 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Tue Jan 17 20:00:45 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 17 20:00:45 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Tue Jan 17 20:00:45 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 17 20:00:46 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Tue Jan 17 20:00:46 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0020.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Tue Jan 17 20:00:46 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0020.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 17 20:00:46 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Jan 17 20:00:46 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 17 20:00:46 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Tue Jan 17 20:00:46 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 17 20:00:46 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Tue Jan 17 20:00:46 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Jan 18 08:04:08 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jan 18 08:04:08 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Jan 18 08:04:08 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Wed Jan 18 08:04:08 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jan 18 08:04:08 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Wed Jan 18 08:04:08 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Wed Jan 18 08:04:08 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jan 18 08:04:09 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Wed Jan 18 08:04:09 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jan 18 08:04:09 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Wed Jan 18 08:04:09 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0021.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Wed Jan 18 08:04:09 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0021.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jan 18 08:04:09 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Jan 18 08:04:09 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jan 18 08:04:09 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Wed Jan 18 08:04:09 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jan 18 08:04:09 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Wed Jan 18 08:04:09 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Jan 18 12:00:58 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jan 18 12:00:58 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Jan 18 12:00:58 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Wed Jan 18 12:00:58 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jan 18 12:00:58 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Wed Jan 18 12:00:58 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Wed Jan 18 12:00:58 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jan 18 12:00:58 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Wed Jan 18 12:00:58 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jan 18 12:00:58 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Wed Jan 18 12:00:58 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0022.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Wed Jan 18 12:00:58 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0022.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jan 18 12:00:58 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Jan 18 12:00:58 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jan 18 12:00:58 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Wed Jan 18 12:00:58 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jan 18 12:00:58 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Wed Jan 18 12:00:58 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Jan 18 16:01:19 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jan 18 16:01:19 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Jan 18 16:01:19 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Wed Jan 18 16:01:19 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jan 18 16:01:19 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Wed Jan 18 16:01:19 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Wed Jan 18 16:01:19 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jan 18 16:01:20 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Wed Jan 18 16:01:20 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jan 18 16:01:20 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Wed Jan 18 16:01:20 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0023.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Wed Jan 18 16:01:20 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0023.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jan 18 16:01:20 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Jan 18 16:01:20 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jan 18 16:01:20 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Wed Jan 18 16:01:20 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jan 18 16:01:20 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Wed Jan 18 16:01:20 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Jan 18 20:00:47 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jan 18 20:00:47 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Jan 18 20:00:47 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Wed Jan 18 20:00:47 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jan 18 20:00:47 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Wed Jan 18 20:00:47 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Wed Jan 18 20:00:47 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jan 18 20:00:47 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Wed Jan 18 20:00:47 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jan 18 20:00:47 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Wed Jan 18 20:00:47 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0024.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Wed Jan 18 20:00:47 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0024.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jan 18 20:00:47 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Jan 18 20:00:47 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jan 18 20:00:47 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Wed Jan 18 20:00:47 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jan 18 20:00:47 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Wed Jan 18 20:00:47 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Thu Jan 19 08:04:30 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jan 19 08:04:30 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Thu Jan 19 08:04:30 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Thu Jan 19 08:04:30 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jan 19 08:04:30 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Thu Jan 19 08:04:30 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Thu Jan 19 08:04:30 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jan 19 08:04:30 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Thu Jan 19 08:04:30 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jan 19 08:04:30 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Thu Jan 19 08:04:30 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0025.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Thu Jan 19 08:04:30 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0025.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jan 19 08:04:30 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Thu Jan 19 08:04:31 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jan 19 08:04:31 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Thu Jan 19 08:04:31 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jan 19 08:04:31 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Thu Jan 19 08:04:31 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Thu Jan 19 12:00:56 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jan 19 12:00:56 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Thu Jan 19 12:00:56 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Thu Jan 19 12:00:56 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jan 19 12:00:56 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Thu Jan 19 12:00:56 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Thu Jan 19 12:00:56 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jan 19 12:00:56 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Thu Jan 19 12:00:56 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jan 19 12:00:56 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Thu Jan 19 12:00:56 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0026.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Thu Jan 19 12:00:56 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0026.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jan 19 12:00:56 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Thu Jan 19 12:00:56 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jan 19 12:00:56 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Thu Jan 19 12:00:56 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jan 19 12:00:56 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Thu Jan 19 12:00:56 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Thu Jan 19 16:02:37 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jan 19 16:02:37 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Thu Jan 19 16:02:37 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Thu Jan 19 16:02:37 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jan 19 16:02:37 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Thu Jan 19 16:02:37 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Thu Jan 19 16:02:37 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jan 19 16:02:37 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Thu Jan 19 16:02:37 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jan 19 16:02:38 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Thu Jan 19 16:02:38 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0027.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Thu Jan 19 16:02:38 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0027.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jan 19 16:02:38 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Thu Jan 19 16:02:38 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jan 19 16:02:38 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Thu Jan 19 16:02:38 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jan 19 16:02:38 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Thu Jan 19 16:02:38 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Thu Jan 19 20:00:43 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jan 19 20:00:43 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Thu Jan 19 20:00:43 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Thu Jan 19 20:00:43 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jan 19 20:00:43 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Thu Jan 19 20:00:43 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Thu Jan 19 20:00:43 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jan 19 20:00:43 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Thu Jan 19 20:00:43 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jan 19 20:00:43 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Thu Jan 19 20:00:43 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0028.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Thu Jan 19 20:00:43 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0028.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jan 19 20:00:43 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Thu Jan 19 20:00:43 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jan 19 20:00:43 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Thu Jan 19 20:00:43 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jan 19 20:00:43 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Thu Jan 19 20:00:43 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Jan 20 08:06:19 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 20 08:06:19 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Jan 20 08:06:19 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Fri Jan 20 08:06:19 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 20 08:06:19 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Fri Jan 20 08:06:19 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Fri Jan 20 08:06:19 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 20 08:06:19 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Fri Jan 20 08:06:19 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 20 08:06:20 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Fri Jan 20 08:06:20 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0029.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Fri Jan 20 08:06:20 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0029.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 20 08:06:20 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Jan 20 08:06:20 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 20 08:06:20 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Fri Jan 20 08:06:20 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 20 08:06:20 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Fri Jan 20 08:06:20 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Jan 20 12:01:51 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 20 12:01:51 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Jan 20 12:01:51 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Fri Jan 20 12:01:51 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 20 12:01:51 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Fri Jan 20 12:01:51 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Fri Jan 20 12:01:51 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 20 12:01:51 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Fri Jan 20 12:01:51 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 20 12:01:51 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Fri Jan 20 12:01:51 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0030.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Fri Jan 20 12:01:51 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0030.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 20 12:01:51 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Jan 20 12:01:51 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 20 12:01:51 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Fri Jan 20 12:01:51 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 20 12:01:51 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Fri Jan 20 12:01:51 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Jan 20 16:00:45 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 20 16:00:47 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Jan 20 16:00:47 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Fri Jan 20 16:00:47 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 20 16:00:47 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Fri Jan 20 16:00:47 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Fri Jan 20 16:00:47 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 20 16:00:47 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Fri Jan 20 16:00:47 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 20 16:00:47 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Fri Jan 20 16:00:47 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0031.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Fri Jan 20 16:00:47 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0031.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 20 16:00:47 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Jan 20 16:00:47 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 20 16:00:47 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Fri Jan 20 16:00:47 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 20 16:00:47 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Fri Jan 20 16:00:47 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Jan 20 20:00:43 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 20 20:00:43 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Jan 20 20:00:43 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Fri Jan 20 20:00:43 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 20 20:00:43 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Fri Jan 20 20:00:43 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Fri Jan 20 20:00:43 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 20 20:00:43 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Fri Jan 20 20:00:43 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 20 20:00:43 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Fri Jan 20 20:00:43 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0032.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Fri Jan 20 20:00:43 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0032.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 20 20:00:43 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Jan 20 20:00:43 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 20 20:00:43 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Fri Jan 20 20:00:43 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 20 20:00:43 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Fri Jan 20 20:00:43 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Jan 21 08:03:44 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 21 08:03:44 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Jan 21 08:03:44 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Sat Jan 21 08:03:44 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 21 08:03:44 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Sat Jan 21 08:03:44 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Sat Jan 21 08:03:44 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 21 08:03:44 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Sat Jan 21 08:03:44 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 21 08:03:44 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Sat Jan 21 08:03:45 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0033.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Sat Jan 21 08:03:45 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0033.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 21 08:03:45 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Jan 21 08:03:45 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 21 08:03:45 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sat Jan 21 08:03:45 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 21 08:03:45 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sat Jan 21 08:03:45 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Jan 21 12:00:57 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 21 12:00:57 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Jan 21 12:00:57 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Sat Jan 21 12:00:57 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 21 12:00:57 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Sat Jan 21 12:00:57 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Sat Jan 21 12:00:57 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 21 12:00:57 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Sat Jan 21 12:00:57 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 21 12:00:57 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Sat Jan 21 12:00:57 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0034.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Sat Jan 21 12:00:57 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0034.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 21 12:00:57 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Jan 21 12:00:57 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 21 12:00:57 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sat Jan 21 12:00:57 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 21 12:00:57 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sat Jan 21 12:00:57 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Jan 21 16:00:45 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 21 16:00:45 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Jan 21 16:00:45 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Sat Jan 21 16:00:45 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 21 16:00:45 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Sat Jan 21 16:00:45 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Sat Jan 21 16:00:45 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 21 16:00:45 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Sat Jan 21 16:00:45 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 21 16:00:45 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Sat Jan 21 16:00:45 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0035.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Sat Jan 21 16:00:45 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0035.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 21 16:00:45 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Jan 21 16:00:45 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 21 16:00:45 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sat Jan 21 16:00:45 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 21 16:00:45 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sat Jan 21 16:00:45 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Jan 21 20:00:42 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 21 20:00:46 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Jan 21 20:00:46 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Sat Jan 21 20:00:46 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 21 20:00:46 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Sat Jan 21 20:00:46 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Sat Jan 21 20:00:46 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 21 20:00:46 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Sat Jan 21 20:00:46 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 21 20:00:46 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Sat Jan 21 20:00:46 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0036.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Sat Jan 21 20:00:46 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0036.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 21 20:00:46 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Jan 21 20:00:46 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 21 20:00:46 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sat Jan 21 20:00:46 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 21 20:00:46 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sat Jan 21 20:00:46 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Jan 22 08:02:36 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 22 08:02:36 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Jan 22 08:02:36 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Sun Jan 22 08:02:36 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 22 08:02:36 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Sun Jan 22 08:02:36 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Sun Jan 22 08:02:36 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 22 08:02:36 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Sun Jan 22 08:02:36 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 22 08:02:37 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Sun Jan 22 08:02:37 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0037.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Sun Jan 22 08:02:37 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0037.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 22 08:02:37 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Jan 22 08:02:37 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 22 08:02:37 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sun Jan 22 08:02:37 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 22 08:02:37 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sun Jan 22 08:02:37 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Jan 22 12:00:47 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 22 12:00:47 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Jan 22 12:00:47 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Sun Jan 22 12:00:47 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 22 12:00:47 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Sun Jan 22 12:00:47 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Sun Jan 22 12:00:47 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 22 12:00:47 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Sun Jan 22 12:00:47 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 22 12:00:47 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Sun Jan 22 12:00:47 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0038.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Sun Jan 22 12:00:47 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0038.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 22 12:00:47 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Jan 22 12:00:47 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 22 12:00:47 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sun Jan 22 12:00:47 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 22 12:00:47 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sun Jan 22 12:00:47 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Jan 22 16:01:10 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 22 16:01:10 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Jan 22 16:01:10 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Sun Jan 22 16:01:10 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 22 16:01:10 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Sun Jan 22 16:01:10 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Sun Jan 22 16:01:10 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 22 16:01:10 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Sun Jan 22 16:01:10 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 22 16:01:10 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Sun Jan 22 16:01:10 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0039.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Sun Jan 22 16:01:10 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0039.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 22 16:01:10 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Jan 22 16:01:10 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 22 16:01:10 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sun Jan 22 16:01:10 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 22 16:01:10 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sun Jan 22 16:01:11 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Jan 22 20:01:07 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 22 20:01:07 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Jan 22 20:01:07 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Sun Jan 22 20:01:07 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 22 20:01:07 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Sun Jan 22 20:01:07 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Sun Jan 22 20:01:07 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 22 20:01:07 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Sun Jan 22 20:01:07 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 22 20:01:07 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Sun Jan 22 20:01:08 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0040.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Sun Jan 22 20:01:08 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0040.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 22 20:01:08 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Jan 22 20:01:08 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 22 20:01:08 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sun Jan 22 20:01:08 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 22 20:01:08 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sun Jan 22 20:01:08 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Jan 23 08:02:29 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 23 08:02:29 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Jan 23 08:02:29 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Mon Jan 23 08:02:29 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 23 08:02:29 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Mon Jan 23 08:02:29 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Mon Jan 23 08:02:29 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 23 08:02:29 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Mon Jan 23 08:02:29 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 23 08:02:29 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Mon Jan 23 08:02:29 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0041.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Mon Jan 23 08:02:29 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0041.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 23 08:02:29 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Jan 23 08:02:29 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 23 08:02:29 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Mon Jan 23 08:02:29 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 23 08:02:29 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Mon Jan 23 08:02:29 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Jan 23 12:00:47 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 23 12:00:47 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Jan 23 12:00:47 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Mon Jan 23 12:00:47 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 23 12:00:47 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Mon Jan 23 12:00:47 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Mon Jan 23 12:00:48 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 23 12:00:48 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Mon Jan 23 12:00:48 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 23 12:00:48 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Mon Jan 23 12:00:48 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0042.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Mon Jan 23 12:00:48 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0042.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 23 12:00:48 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Jan 23 12:00:48 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 23 12:00:48 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Mon Jan 23 12:00:48 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 23 12:00:48 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Mon Jan 23 12:00:48 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Jan 23 16:01:35 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 23 16:01:35 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Jan 23 16:01:35 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Mon Jan 23 16:01:35 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 23 16:01:35 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Mon Jan 23 16:01:35 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Mon Jan 23 16:01:35 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 23 16:01:35 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Mon Jan 23 16:01:35 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 23 16:01:35 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Mon Jan 23 16:01:35 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0043.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Mon Jan 23 16:01:35 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0043.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 23 16:01:35 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Jan 23 16:01:35 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 23 16:01:35 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Mon Jan 23 16:01:35 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 23 16:01:35 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Mon Jan 23 16:01:35 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Jan 23 20:00:46 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 23 20:00:47 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Jan 23 20:00:47 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Mon Jan 23 20:00:47 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 23 20:00:47 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Mon Jan 23 20:00:47 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Mon Jan 23 20:00:47 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 23 20:00:47 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Mon Jan 23 20:00:47 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 23 20:00:47 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Mon Jan 23 20:00:47 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0044.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Mon Jan 23 20:00:47 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0044.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 23 20:00:47 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Jan 23 20:00:47 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 23 20:00:47 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Mon Jan 23 20:00:47 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 23 20:00:47 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Mon Jan 23 20:00:47 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Jan 24 08:03:00 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 24 08:03:00 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Jan 24 08:03:00 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Tue Jan 24 08:03:00 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 24 08:03:00 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Tue Jan 24 08:03:00 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Tue Jan 24 08:03:00 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 24 08:03:00 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Tue Jan 24 08:03:00 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 24 08:03:00 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Tue Jan 24 08:03:01 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0045.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Tue Jan 24 08:03:01 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0045.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 24 08:03:01 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Jan 24 08:03:01 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 24 08:03:01 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Tue Jan 24 08:03:01 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 24 08:03:01 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Tue Jan 24 08:03:01 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Jan 24 12:02:34 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 24 12:02:34 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Jan 24 12:02:34 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Tue Jan 24 12:02:34 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 24 12:02:34 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Tue Jan 24 12:02:34 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Tue Jan 24 12:02:35 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 24 12:02:35 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Tue Jan 24 12:02:35 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 24 12:02:35 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Tue Jan 24 12:02:35 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0046.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Tue Jan 24 12:02:35 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0046.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 24 12:02:35 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Jan 24 12:02:35 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 24 12:02:35 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Tue Jan 24 12:02:35 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 24 12:02:35 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Tue Jan 24 12:02:36 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Jan 24 16:01:13 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 24 16:01:13 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Jan 24 16:01:13 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Tue Jan 24 16:01:14 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 24 16:01:14 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Tue Jan 24 16:01:14 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Tue Jan 24 16:01:14 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 24 16:01:14 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Tue Jan 24 16:01:14 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 24 16:01:14 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Tue Jan 24 16:01:14 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0047.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Tue Jan 24 16:01:14 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0047.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 24 16:01:14 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Jan 24 16:01:14 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 24 16:01:14 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Tue Jan 24 16:01:14 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 24 16:01:14 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Tue Jan 24 16:01:14 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Jan 24 20:01:46 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 24 20:01:46 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Jan 24 20:01:46 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Tue Jan 24 20:01:46 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 24 20:01:46 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Tue Jan 24 20:01:46 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Tue Jan 24 20:01:46 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 24 20:01:46 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Tue Jan 24 20:01:46 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 24 20:01:46 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Tue Jan 24 20:01:46 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0048.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Tue Jan 24 20:01:47 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0048.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 24 20:01:47 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Jan 24 20:01:47 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 24 20:01:47 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Tue Jan 24 20:01:47 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 24 20:01:47 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Tue Jan 24 20:01:47 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Jan 25 08:01:54 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jan 25 08:01:54 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Jan 25 08:01:54 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Wed Jan 25 08:01:54 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jan 25 08:01:54 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Wed Jan 25 08:01:54 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Wed Jan 25 08:01:54 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jan 25 08:01:54 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Wed Jan 25 08:01:54 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jan 25 08:01:54 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Wed Jan 25 08:01:54 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0049.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Wed Jan 25 08:01:54 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0049.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jan 25 08:01:54 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Jan 25 08:01:54 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jan 25 08:01:55 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Wed Jan 25 08:01:55 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jan 25 08:01:55 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Wed Jan 25 08:01:55 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Jan 25 12:00:54 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jan 25 12:00:55 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Jan 25 12:00:55 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Wed Jan 25 12:00:55 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jan 25 12:00:55 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Wed Jan 25 12:00:55 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Wed Jan 25 12:00:55 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jan 25 12:00:55 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Wed Jan 25 12:00:55 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jan 25 12:00:55 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Wed Jan 25 12:00:56 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0050.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Wed Jan 25 12:00:56 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0050.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jan 25 12:00:56 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Jan 25 12:00:56 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jan 25 12:00:56 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Wed Jan 25 12:00:56 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jan 25 12:00:56 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Wed Jan 25 12:00:56 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Jan 25 16:00:52 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jan 25 16:00:52 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Jan 25 16:00:52 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Wed Jan 25 16:00:52 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jan 25 16:00:52 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Wed Jan 25 16:00:52 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Wed Jan 25 16:00:52 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jan 25 16:00:52 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Wed Jan 25 16:00:52 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jan 25 16:00:52 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Wed Jan 25 16:00:52 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0051.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Wed Jan 25 16:00:52 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0051.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jan 25 16:00:53 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Jan 25 16:00:53 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jan 25 16:00:53 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Wed Jan 25 16:00:53 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jan 25 16:00:53 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Wed Jan 25 16:00:53 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Jan 25 20:00:48 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jan 25 20:00:48 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Jan 25 20:00:48 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Wed Jan 25 20:00:48 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jan 25 20:00:48 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Wed Jan 25 20:00:49 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Wed Jan 25 20:00:49 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jan 25 20:00:49 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Wed Jan 25 20:00:49 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jan 25 20:00:49 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Wed Jan 25 20:00:49 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0052.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Wed Jan 25 20:00:49 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0052.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jan 25 20:00:49 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Jan 25 20:00:49 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jan 25 20:00:49 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Wed Jan 25 20:00:49 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jan 25 20:00:49 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Wed Jan 25 20:00:49 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Thu Jan 26 08:05:13 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jan 26 08:05:13 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Thu Jan 26 08:05:13 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Thu Jan 26 08:05:13 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jan 26 08:05:13 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Thu Jan 26 08:05:13 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Thu Jan 26 08:05:13 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jan 26 08:05:13 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Thu Jan 26 08:05:13 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jan 26 08:05:13 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Thu Jan 26 08:05:14 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0053.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Thu Jan 26 08:05:16 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0053.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jan 26 08:05:16 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Thu Jan 26 08:05:16 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jan 26 08:05:16 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Thu Jan 26 08:05:16 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jan 26 08:05:16 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Thu Jan 26 08:05:16 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Thu Jan 26 12:01:00 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jan 26 12:01:00 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Thu Jan 26 12:01:00 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Thu Jan 26 12:01:00 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jan 26 12:01:00 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Thu Jan 26 12:01:00 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Thu Jan 26 12:01:00 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jan 26 12:01:00 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Thu Jan 26 12:01:00 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jan 26 12:01:00 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Thu Jan 26 12:01:00 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0054.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Thu Jan 26 12:01:00 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0054.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jan 26 12:01:00 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Thu Jan 26 12:01:00 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jan 26 12:01:00 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Thu Jan 26 12:01:00 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jan 26 12:01:00 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Thu Jan 26 12:01:00 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Thu Jan 26 16:00:47 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jan 26 16:00:47 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Thu Jan 26 16:00:47 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Thu Jan 26 16:00:47 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jan 26 16:00:47 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Thu Jan 26 16:00:47 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Thu Jan 26 16:00:47 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jan 26 16:00:47 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Thu Jan 26 16:00:47 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jan 26 16:00:47 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Thu Jan 26 16:00:47 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0055.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Thu Jan 26 16:00:47 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0055.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jan 26 16:00:47 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Thu Jan 26 16:00:47 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jan 26 16:00:47 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Thu Jan 26 16:00:47 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jan 26 16:00:47 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Thu Jan 26 16:00:47 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Thu Jan 26 20:00:43 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jan 26 20:00:43 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Thu Jan 26 20:00:43 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Thu Jan 26 20:00:43 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jan 26 20:00:43 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Thu Jan 26 20:00:43 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Thu Jan 26 20:00:43 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jan 26 20:00:43 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Thu Jan 26 20:00:43 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jan 26 20:00:43 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Thu Jan 26 20:00:43 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0056.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Thu Jan 26 20:00:43 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0056.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jan 26 20:00:43 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Thu Jan 26 20:00:43 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jan 26 20:00:43 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Thu Jan 26 20:00:43 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jan 26 20:00:43 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Thu Jan 26 20:00:43 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Jan 27 08:06:11 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 27 08:06:11 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Jan 27 08:06:11 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Fri Jan 27 08:06:11 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 27 08:06:11 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Fri Jan 27 08:06:11 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Fri Jan 27 08:06:11 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 27 08:06:11 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Fri Jan 27 08:06:11 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 27 08:06:11 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Fri Jan 27 08:06:12 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0057.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Fri Jan 27 08:06:12 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0057.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 27 08:06:12 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Jan 27 08:06:12 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 27 08:06:12 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Fri Jan 27 08:06:12 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 27 08:06:13 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Fri Jan 27 08:06:13 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Jan 27 12:02:01 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 27 12:02:01 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Jan 27 12:02:01 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Fri Jan 27 12:02:01 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 27 12:02:01 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Fri Jan 27 12:02:01 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Fri Jan 27 12:02:01 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 27 12:02:01 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Fri Jan 27 12:02:01 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 27 12:02:01 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Fri Jan 27 12:02:02 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0058.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Fri Jan 27 12:02:03 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0058.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 27 12:02:03 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Jan 27 12:02:03 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 27 12:02:03 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Fri Jan 27 12:02:03 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 27 12:02:03 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Fri Jan 27 12:02:03 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Jan 27 16:00:59 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 27 16:00:59 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Jan 27 16:00:59 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Fri Jan 27 16:00:59 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 27 16:00:59 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Fri Jan 27 16:00:59 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Fri Jan 27 16:00:59 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 27 16:00:59 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Fri Jan 27 16:00:59 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 27 16:00:59 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Fri Jan 27 16:00:59 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0059.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Fri Jan 27 16:00:59 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0059.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 27 16:00:59 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Jan 27 16:00:59 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 27 16:00:59 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Fri Jan 27 16:00:59 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 27 16:00:59 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Fri Jan 27 16:00:59 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Jan 27 20:00:50 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 27 20:00:50 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Jan 27 20:00:50 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Fri Jan 27 20:00:50 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 27 20:00:50 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Fri Jan 27 20:00:50 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Fri Jan 27 20:00:50 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 27 20:00:50 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Fri Jan 27 20:00:50 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 27 20:00:50 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Fri Jan 27 20:00:50 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0060.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Fri Jan 27 20:00:50 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0060.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 27 20:00:50 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Jan 27 20:00:50 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 27 20:00:50 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Fri Jan 27 20:00:50 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Jan 27 20:00:50 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Fri Jan 27 20:00:50 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Jan 28 08:05:19 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 28 08:05:19 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Jan 28 08:05:19 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Sat Jan 28 08:05:19 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 28 08:05:19 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Sat Jan 28 08:05:19 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Sat Jan 28 08:05:19 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 28 08:05:19 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Sat Jan 28 08:05:19 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 28 08:05:19 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Sat Jan 28 08:05:20 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0061.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Sat Jan 28 08:05:20 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0061.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 28 08:05:20 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Jan 28 08:05:20 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 28 08:05:20 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sat Jan 28 08:05:20 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 28 08:05:20 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sat Jan 28 08:05:20 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Jan 28 12:01:49 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 28 12:01:49 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Jan 28 12:01:49 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Sat Jan 28 12:01:49 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 28 12:01:49 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Sat Jan 28 12:01:49 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Sat Jan 28 12:01:49 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 28 12:01:49 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Sat Jan 28 12:01:49 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 28 12:01:49 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Sat Jan 28 12:01:49 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0062.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Sat Jan 28 12:01:49 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0062.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 28 12:01:49 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Jan 28 12:01:49 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 28 12:01:49 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sat Jan 28 12:01:49 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 28 12:01:49 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sat Jan 28 12:01:49 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Jan 28 16:00:48 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 28 16:00:48 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Jan 28 16:00:49 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Sat Jan 28 16:00:49 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 28 16:00:49 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Sat Jan 28 16:00:49 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Sat Jan 28 16:00:49 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 28 16:00:49 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Sat Jan 28 16:00:49 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 28 16:00:49 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Sat Jan 28 16:00:49 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0063.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Sat Jan 28 16:00:50 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0063.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 28 16:00:50 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Jan 28 16:00:50 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 28 16:00:50 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sat Jan 28 16:00:50 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 28 16:00:50 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sat Jan 28 16:00:50 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Jan 28 20:00:50 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 28 20:00:50 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Jan 28 20:00:50 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Sat Jan 28 20:00:50 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 28 20:00:50 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Sat Jan 28 20:00:50 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Sat Jan 28 20:00:50 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 28 20:00:50 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Sat Jan 28 20:00:50 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 28 20:00:50 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Sat Jan 28 20:00:50 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0064.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Sat Jan 28 20:00:50 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0064.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 28 20:00:50 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Jan 28 20:00:50 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 28 20:00:50 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sat Jan 28 20:00:50 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Jan 28 20:00:50 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sat Jan 28 20:00:50 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Jan 29 08:06:57 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 29 08:06:58 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Jan 29 08:06:58 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Sun Jan 29 08:06:58 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 29 08:06:58 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Sun Jan 29 08:06:58 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Sun Jan 29 08:06:58 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 29 08:06:59 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Sun Jan 29 08:06:59 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 29 08:06:59 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Sun Jan 29 08:07:01 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0065.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Sun Jan 29 08:07:02 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0065.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 29 08:07:02 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Jan 29 08:07:02 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 29 08:07:02 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sun Jan 29 08:07:02 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 29 08:07:02 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sun Jan 29 08:07:02 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Jan 29 12:00:56 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 29 12:00:56 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Jan 29 12:00:56 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Sun Jan 29 12:00:56 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 29 12:00:56 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Sun Jan 29 12:00:56 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Sun Jan 29 12:00:56 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 29 12:00:56 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Sun Jan 29 12:00:56 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 29 12:00:56 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Sun Jan 29 12:00:56 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0066.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Sun Jan 29 12:00:56 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0066.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 29 12:00:56 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Jan 29 12:00:56 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 29 12:00:57 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sun Jan 29 12:00:57 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 29 12:00:57 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sun Jan 29 12:00:57 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Jan 29 16:00:48 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 29 16:00:48 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Jan 29 16:00:48 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Sun Jan 29 16:00:48 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 29 16:00:48 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Sun Jan 29 16:00:48 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Sun Jan 29 16:00:48 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 29 16:00:48 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Sun Jan 29 16:00:48 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 29 16:00:48 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Sun Jan 29 16:00:48 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0067.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Sun Jan 29 16:00:48 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0067.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 29 16:00:48 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Jan 29 16:00:48 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 29 16:00:48 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sun Jan 29 16:00:48 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 29 16:00:48 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sun Jan 29 16:00:48 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Jan 29 20:00:49 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 29 20:00:49 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Jan 29 20:00:49 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Sun Jan 29 20:00:49 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 29 20:00:49 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Sun Jan 29 20:00:49 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Sun Jan 29 20:00:49 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 29 20:00:49 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Sun Jan 29 20:00:49 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 29 20:00:49 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Sun Jan 29 20:00:49 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0068.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Sun Jan 29 20:00:49 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0068.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 29 20:00:49 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Jan 29 20:00:49 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 29 20:00:49 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sun Jan 29 20:00:49 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jan 29 20:00:49 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sun Jan 29 20:00:49 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Jan 30 08:07:42 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 30 08:07:43 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Jan 30 08:07:43 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Mon Jan 30 08:07:43 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 30 08:07:43 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Mon Jan 30 08:07:44 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Mon Jan 30 08:07:44 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 30 08:07:44 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Mon Jan 30 08:07:44 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 30 08:07:44 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Mon Jan 30 08:07:47 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0069.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Mon Jan 30 08:07:47 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0069.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 30 08:07:48 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Jan 30 08:07:48 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 30 08:07:48 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Mon Jan 30 08:07:48 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 30 08:07:48 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Mon Jan 30 08:07:48 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Jan 30 12:03:39 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 30 12:03:40 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Jan 30 12:03:40 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Mon Jan 30 12:03:40 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 30 12:03:40 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Mon Jan 30 12:03:40 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Mon Jan 30 12:03:40 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 30 12:03:40 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Mon Jan 30 12:03:40 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 30 12:03:40 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Mon Jan 30 12:03:41 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0070.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Mon Jan 30 12:03:41 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0070.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 30 12:03:41 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Jan 30 12:03:41 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 30 12:03:41 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Mon Jan 30 12:03:41 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 30 12:03:41 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Mon Jan 30 12:03:41 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Jan 30 16:03:53 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 30 16:03:54 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Jan 30 16:03:54 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Mon Jan 30 16:03:54 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 30 16:03:54 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Mon Jan 30 16:03:54 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Mon Jan 30 16:03:54 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 30 16:03:54 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Mon Jan 30 16:03:54 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 30 16:03:54 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Mon Jan 30 16:03:56 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0071.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Mon Jan 30 16:03:56 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0071.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 30 16:03:56 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Jan 30 16:03:56 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 30 16:03:56 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Mon Jan 30 16:03:56 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 30 16:03:56 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Mon Jan 30 16:03:56 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Jan 30 20:02:01 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 30 20:02:01 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Jan 30 20:02:01 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Mon Jan 30 20:02:01 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 30 20:02:01 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Mon Jan 30 20:02:01 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Mon Jan 30 20:02:01 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 30 20:02:01 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Mon Jan 30 20:02:01 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 30 20:02:01 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Mon Jan 30 20:02:02 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0072.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Mon Jan 30 20:02:02 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0072.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 30 20:02:02 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Jan 30 20:02:02 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 30 20:02:03 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Mon Jan 30 20:02:03 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jan 30 20:02:03 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Mon Jan 30 20:02:03 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Jan 31 08:07:27 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 31 08:07:28 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Jan 31 08:07:28 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Tue Jan 31 08:07:28 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 31 08:07:28 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Tue Jan 31 08:07:28 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Tue Jan 31 08:07:28 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 31 08:07:28 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Tue Jan 31 08:07:28 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 31 08:07:28 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Tue Jan 31 08:07:30 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0073.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Tue Jan 31 08:07:30 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0073.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 31 08:07:30 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Jan 31 08:07:30 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 31 08:07:30 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Tue Jan 31 08:07:30 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 31 08:07:30 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Tue Jan 31 08:07:30 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Jan 31 12:04:00 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 31 12:04:01 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Jan 31 12:04:01 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Tue Jan 31 12:04:01 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 31 12:04:01 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Tue Jan 31 12:04:01 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Tue Jan 31 12:04:01 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 31 12:04:01 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Tue Jan 31 12:04:01 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 31 12:04:01 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Tue Jan 31 12:04:02 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0074.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Tue Jan 31 12:04:02 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0074.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 31 12:04:02 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Jan 31 12:04:02 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 31 12:04:02 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Tue Jan 31 12:04:02 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 31 12:04:02 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Tue Jan 31 12:04:02 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Jan 31 16:02:05 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 31 16:02:05 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Jan 31 16:02:05 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Tue Jan 31 16:02:05 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 31 16:02:05 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Tue Jan 31 16:02:05 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Tue Jan 31 16:02:05 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 31 16:02:05 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Tue Jan 31 16:02:05 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 31 16:02:06 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Tue Jan 31 16:02:06 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0075.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Tue Jan 31 16:02:06 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0075.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 31 16:02:06 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Jan 31 16:02:06 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 31 16:02:06 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Tue Jan 31 16:02:07 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 31 16:02:07 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Tue Jan 31 16:02:07 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Jan 31 20:01:00 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 31 20:01:00 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Jan 31 20:01:00 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Tue Jan 31 20:01:00 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 31 20:01:00 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Tue Jan 31 20:01:00 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Tue Jan 31 20:01:00 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 31 20:01:00 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Tue Jan 31 20:01:00 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 31 20:01:00 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Tue Jan 31 20:01:00 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0076.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Tue Jan 31 20:01:00 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0076.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 31 20:01:00 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Jan 31 20:01:00 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 31 20:01:01 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Tue Jan 31 20:01:01 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Jan 31 20:01:01 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Tue Jan 31 20:01:01 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Feb 1 08:09:13 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 1 08:09:13 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Feb 1 08:09:13 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Wed Feb 1 08:09:13 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 1 08:09:13 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Wed Feb 1 08:09:13 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Wed Feb 1 08:09:13 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 1 08:09:13 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Wed Feb 1 08:09:13 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 1 08:09:13 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Wed Feb 1 08:09:15 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0077.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Wed Feb 1 08:09:15 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0077.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 1 08:09:15 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Feb 1 08:09:15 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 1 08:09:15 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Wed Feb 1 08:09:15 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 1 08:09:15 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Wed Feb 1 08:09:15 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Feb 1 12:02:27 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 1 12:02:27 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Feb 1 12:02:27 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Wed Feb 1 12:02:27 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 1 12:02:27 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Wed Feb 1 12:02:27 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Wed Feb 1 12:02:27 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 1 12:02:27 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Wed Feb 1 12:02:27 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 1 12:02:27 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Wed Feb 1 12:02:28 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0078.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Wed Feb 1 12:02:28 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0078.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 1 12:02:28 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Feb 1 12:02:28 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 1 12:02:28 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Wed Feb 1 12:02:28 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 1 12:02:30 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Wed Feb 1 12:02:30 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Feb 1 16:00:57 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 1 16:00:57 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Feb 1 16:00:57 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Wed Feb 1 16:00:57 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 1 16:00:57 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Wed Feb 1 16:00:57 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Wed Feb 1 16:00:57 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 1 16:00:57 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Wed Feb 1 16:00:57 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 1 16:00:57 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Wed Feb 1 16:00:57 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0079.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Wed Feb 1 16:00:57 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0079.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 1 16:00:57 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Feb 1 16:00:57 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 1 16:00:57 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Wed Feb 1 16:00:57 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 1 16:00:57 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Wed Feb 1 16:00:57 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Feb 1 20:00:47 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 1 20:00:47 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Feb 1 20:00:47 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Wed Feb 1 20:00:47 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 1 20:00:47 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Wed Feb 1 20:00:48 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Wed Feb 1 20:00:48 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 1 20:00:48 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Wed Feb 1 20:00:48 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 1 20:00:48 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Wed Feb 1 20:00:48 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0080.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Wed Feb 1 20:00:48 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0080.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 1 20:00:48 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Feb 1 20:00:48 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 1 20:00:48 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Wed Feb 1 20:00:48 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 1 20:00:48 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Wed Feb 1 20:00:48 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Thu Feb 2 08:11:33 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 2 08:11:33 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Thu Feb 2 08:11:33 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Thu Feb 2 08:11:33 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 2 08:11:33 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Thu Feb 2 08:11:33 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Thu Feb 2 08:11:33 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 2 08:11:33 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Thu Feb 2 08:11:33 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 2 08:11:33 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Thu Feb 2 08:11:36 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0081.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Thu Feb 2 08:11:36 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0081.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 2 08:11:36 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Thu Feb 2 08:11:36 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 2 08:11:36 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Thu Feb 2 08:11:37 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 2 08:11:37 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Thu Feb 2 08:11:37 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Thu Feb 2 12:02:35 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 2 12:02:35 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Thu Feb 2 12:02:35 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Thu Feb 2 12:02:35 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 2 12:02:35 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Thu Feb 2 12:02:35 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Thu Feb 2 12:02:35 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 2 12:02:35 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Thu Feb 2 12:02:35 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 2 12:02:35 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Thu Feb 2 12:02:37 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0082.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Thu Feb 2 12:02:37 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0082.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 2 12:02:37 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Thu Feb 2 12:02:37 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 2 12:02:37 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Thu Feb 2 12:02:37 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 2 12:02:37 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Thu Feb 2 12:02:37 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Thu Feb 2 16:01:05 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 2 16:01:05 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Thu Feb 2 16:01:05 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Thu Feb 2 16:01:05 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 2 16:01:05 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Thu Feb 2 16:01:05 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Thu Feb 2 16:01:05 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 2 16:01:05 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Thu Feb 2 16:01:05 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 2 16:01:05 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Thu Feb 2 16:01:05 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0083.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Thu Feb 2 16:01:05 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0083.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 2 16:01:05 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Thu Feb 2 16:01:05 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 2 16:01:05 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Thu Feb 2 16:01:05 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 2 16:01:05 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Thu Feb 2 16:01:05 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Thu Feb 2 20:00:54 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 2 20:00:54 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Thu Feb 2 20:00:54 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Thu Feb 2 20:00:54 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 2 20:00:54 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Thu Feb 2 20:00:54 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Thu Feb 2 20:00:54 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 2 20:00:54 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Thu Feb 2 20:00:54 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 2 20:00:54 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Thu Feb 2 20:00:54 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0084.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Thu Feb 2 20:00:54 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0084.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 2 20:00:54 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Thu Feb 2 20:00:54 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 2 20:00:54 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Thu Feb 2 20:00:54 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 2 20:00:54 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Thu Feb 2 20:00:54 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Feb 3 08:11:02 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Feb 3 08:11:04 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Feb 3 08:11:05 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Fri Feb 3 08:11:05 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Feb 3 08:11:05 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Fri Feb 3 08:11:05 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Fri Feb 3 08:11:05 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Feb 3 08:11:05 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Fri Feb 3 08:11:05 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Feb 3 08:11:05 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Fri Feb 3 08:11:08 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0085.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Fri Feb 3 08:11:09 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0085.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Feb 3 08:11:09 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Feb 3 08:11:09 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Feb 3 08:11:09 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Fri Feb 3 08:11:09 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Feb 3 08:11:09 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Fri Feb 3 08:11:09 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Feb 3 12:02:24 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Feb 3 12:02:24 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Feb 3 12:02:24 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Fri Feb 3 12:02:24 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Feb 3 12:02:24 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Fri Feb 3 12:02:24 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Fri Feb 3 12:02:24 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Feb 3 12:02:24 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Fri Feb 3 12:02:24 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Feb 3 12:02:24 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Fri Feb 3 12:02:25 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0086.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Fri Feb 3 12:02:25 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0086.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Feb 3 12:02:25 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Feb 3 12:02:26 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Feb 3 12:02:26 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Fri Feb 3 12:02:26 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Feb 3 12:02:26 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Fri Feb 3 12:02:26 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Feb 3 16:00:52 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Feb 3 16:00:52 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Feb 3 16:00:52 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Fri Feb 3 16:00:52 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Feb 3 16:00:52 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Fri Feb 3 16:00:52 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Fri Feb 3 16:00:52 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Feb 3 16:00:53 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Fri Feb 3 16:00:53 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Feb 3 16:00:53 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Fri Feb 3 16:00:53 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0087.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Fri Feb 3 16:00:53 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0087.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Feb 3 16:00:53 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Feb 3 16:00:53 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Feb 3 16:00:53 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Fri Feb 3 16:00:53 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Feb 3 16:00:53 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Fri Feb 3 16:00:53 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Feb 3 20:00:57 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Feb 3 20:00:57 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Feb 3 20:00:57 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Fri Feb 3 20:00:57 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Feb 3 20:00:57 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Fri Feb 3 20:00:57 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Fri Feb 3 20:00:57 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Feb 3 20:00:57 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Fri Feb 3 20:00:57 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Feb 3 20:00:57 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Fri Feb 3 20:00:57 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0088.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Fri Feb 3 20:00:57 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0088.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Feb 3 20:00:57 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Feb 3 20:00:57 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Feb 3 20:00:57 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Fri Feb 3 20:00:57 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Feb 3 20:00:57 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Fri Feb 3 20:00:57 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Feb 4 08:07:02 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Feb 4 08:07:03 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Feb 4 08:07:03 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Sat Feb 4 08:07:03 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Feb 4 08:07:03 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Sat Feb 4 08:07:03 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Sat Feb 4 08:07:03 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Feb 4 08:07:04 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Sat Feb 4 08:07:04 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Feb 4 08:07:04 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Sat Feb 4 08:07:08 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0089.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Sat Feb 4 08:07:08 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0089.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Feb 4 08:07:08 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Feb 4 08:07:08 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Feb 4 08:07:08 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sat Feb 4 08:07:08 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Feb 4 08:07:08 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sat Feb 4 08:07:08 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Feb 4 12:02:25 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Feb 4 12:02:26 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Feb 4 12:02:26 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Sat Feb 4 12:02:26 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Feb 4 12:02:26 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Sat Feb 4 12:02:26 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Sat Feb 4 12:02:26 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Feb 4 12:02:26 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Sat Feb 4 12:02:26 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Feb 4 12:02:26 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Sat Feb 4 12:02:27 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0090.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Sat Feb 4 12:02:27 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0090.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Feb 4 12:02:27 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Feb 4 12:02:27 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Feb 4 12:02:27 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sat Feb 4 12:02:27 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Feb 4 12:02:27 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sat Feb 4 12:02:27 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Feb 4 16:01:06 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Feb 4 16:01:06 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Feb 4 16:01:06 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Sat Feb 4 16:01:06 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Feb 4 16:01:06 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Sat Feb 4 16:01:06 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Sat Feb 4 16:01:06 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Feb 4 16:01:06 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Sat Feb 4 16:01:06 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Feb 4 16:01:06 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Sat Feb 4 16:01:06 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0091.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Sat Feb 4 16:01:07 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0091.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Feb 4 16:01:07 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Feb 4 16:01:07 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Feb 4 16:01:07 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sat Feb 4 16:01:07 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Feb 4 16:01:07 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sat Feb 4 16:01:07 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Feb 4 20:00:58 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Feb 4 20:00:58 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Feb 4 20:00:58 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Sat Feb 4 20:00:58 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Feb 4 20:00:58 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Sat Feb 4 20:00:58 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Sat Feb 4 20:00:58 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Feb 4 20:00:59 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Sat Feb 4 20:00:59 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Feb 4 20:00:59 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Sat Feb 4 20:00:59 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0092.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Sat Feb 4 20:00:59 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0092.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Feb 4 20:00:59 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Feb 4 20:00:59 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Feb 4 20:00:59 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sat Feb 4 20:00:59 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Feb 4 20:00:59 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sat Feb 4 20:00:59 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Feb 5 08:07:24 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Feb 5 08:07:25 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Feb 5 08:07:25 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Sun Feb 5 08:07:25 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Feb 5 08:07:25 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Sun Feb 5 08:07:25 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Sun Feb 5 08:07:25 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Feb 5 08:07:25 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Sun Feb 5 08:07:25 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Feb 5 08:07:25 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Sun Feb 5 08:07:27 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0093.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Sun Feb 5 08:07:27 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0093.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Feb 5 08:07:27 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Feb 5 08:07:28 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Feb 5 08:07:28 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sun Feb 5 08:07:28 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Feb 5 08:07:28 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sun Feb 5 08:07:28 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Feb 5 12:02:28 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Feb 5 12:02:28 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Feb 5 12:02:28 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Sun Feb 5 12:02:28 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Feb 5 12:02:28 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Sun Feb 5 12:02:29 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Sun Feb 5 12:02:29 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Feb 5 12:02:29 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Sun Feb 5 12:02:29 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Feb 5 12:02:29 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Sun Feb 5 12:02:30 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0094.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Sun Feb 5 12:02:30 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0094.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Feb 5 12:02:30 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Feb 5 12:02:30 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Feb 5 12:02:30 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sun Feb 5 12:02:30 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Feb 5 12:02:30 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sun Feb 5 12:02:30 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Feb 5 16:01:01 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Feb 5 16:01:01 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Feb 5 16:01:01 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Sun Feb 5 16:01:01 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Feb 5 16:01:01 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Sun Feb 5 16:01:01 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Sun Feb 5 16:01:01 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Feb 5 16:01:01 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Sun Feb 5 16:01:01 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Feb 5 16:01:01 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Sun Feb 5 16:01:01 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0095.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Sun Feb 5 16:01:01 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0095.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Feb 5 16:01:01 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Feb 5 16:01:01 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Feb 5 16:01:01 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sun Feb 5 16:01:01 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Feb 5 16:01:01 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sun Feb 5 16:01:01 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Feb 5 20:00:55 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Feb 5 20:00:55 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Feb 5 20:00:55 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Sun Feb 5 20:00:55 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Feb 5 20:00:55 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Sun Feb 5 20:00:55 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Sun Feb 5 20:00:55 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Feb 5 20:00:55 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Sun Feb 5 20:00:55 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Feb 5 20:00:55 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Sun Feb 5 20:00:55 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0096.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Sun Feb 5 20:00:55 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0096.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Feb 5 20:00:55 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Feb 5 20:00:55 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Feb 5 20:00:55 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sun Feb 5 20:00:55 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Feb 5 20:00:55 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sun Feb 5 20:00:55 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Feb 6 08:12:44 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Feb 6 08:12:46 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Feb 6 08:12:46 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Mon Feb 6 08:12:46 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Feb 6 08:12:46 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Mon Feb 6 08:12:46 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Mon Feb 6 08:12:46 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Feb 6 08:12:46 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Mon Feb 6 08:12:46 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Feb 6 08:12:46 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Mon Feb 6 08:12:54 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0097.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Mon Feb 6 08:12:55 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0097.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Feb 6 08:12:55 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Feb 6 08:12:55 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Feb 6 08:12:55 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Mon Feb 6 08:12:55 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Feb 6 08:12:55 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Mon Feb 6 08:12:55 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Feb 6 12:02:24 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Feb 6 12:02:24 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Feb 6 12:02:24 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Mon Feb 6 12:02:24 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Feb 6 12:02:24 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Mon Feb 6 12:02:24 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Mon Feb 6 12:02:24 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Feb 6 12:02:24 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Mon Feb 6 12:02:24 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Feb 6 12:02:24 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Mon Feb 6 12:02:25 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0098.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Mon Feb 6 12:02:26 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0098.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Feb 6 12:02:26 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Feb 6 12:02:26 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Feb 6 12:02:26 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Mon Feb 6 12:02:26 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Feb 6 12:02:26 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Mon Feb 6 12:02:26 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Feb 6 16:01:01 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Feb 6 16:01:01 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Feb 6 16:01:01 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Mon Feb 6 16:01:01 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Feb 6 16:01:01 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Mon Feb 6 16:01:01 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Mon Feb 6 16:01:01 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Feb 6 16:01:01 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Mon Feb 6 16:01:01 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Feb 6 16:01:01 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Mon Feb 6 16:01:01 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0099.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Mon Feb 6 16:01:01 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0099.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Feb 6 16:01:01 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Feb 6 16:01:01 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Feb 6 16:01:01 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Mon Feb 6 16:01:01 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Feb 6 16:01:01 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Mon Feb 6 16:01:01 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Feb 6 20:00:54 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Feb 6 20:00:54 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Feb 6 20:00:55 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Mon Feb 6 20:00:55 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Feb 6 20:00:55 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Mon Feb 6 20:00:55 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Mon Feb 6 20:00:55 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Feb 6 20:00:55 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Mon Feb 6 20:00:55 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Feb 6 20:00:55 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Mon Feb 6 20:00:55 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0100.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Mon Feb 6 20:00:55 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0100.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Feb 6 20:00:55 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Feb 6 20:00:55 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Feb 6 20:00:55 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Mon Feb 6 20:00:55 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Feb 6 20:00:55 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Mon Feb 6 20:00:55 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Feb 7 08:19:21 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Feb 7 08:19:24 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Feb 7 08:19:24 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Tue Feb 7 08:19:24 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Feb 7 08:19:24 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Tue Feb 7 08:19:25 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Tue Feb 7 08:19:25 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Feb 7 08:19:25 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Tue Feb 7 08:19:25 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Feb 7 08:19:25 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Tue Feb 7 08:20:04 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0101.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Tue Feb 7 08:20:07 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0101.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Feb 7 08:20:08 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Feb 7 08:20:08 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Feb 7 08:20:08 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Tue Feb 7 08:20:08 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Feb 7 08:20:09 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Tue Feb 7 08:20:09 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Feb 7 12:03:01 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Feb 7 12:03:01 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Feb 7 12:03:01 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Tue Feb 7 12:03:01 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Feb 7 12:03:01 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Tue Feb 7 12:03:01 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Tue Feb 7 12:03:01 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Feb 7 12:03:01 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Tue Feb 7 12:03:01 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Feb 7 12:03:01 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Tue Feb 7 12:03:03 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0102.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Tue Feb 7 12:03:04 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0102.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Feb 7 12:03:04 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Feb 7 12:03:04 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Feb 7 12:03:04 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Tue Feb 7 12:03:04 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Feb 7 12:03:04 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Tue Feb 7 12:03:04 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Feb 7 16:01:01 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Feb 7 16:01:01 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Feb 7 16:01:01 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Tue Feb 7 16:01:01 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Feb 7 16:01:01 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Tue Feb 7 16:01:01 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Tue Feb 7 16:01:01 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Feb 7 16:01:04 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Tue Feb 7 16:01:04 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Feb 7 16:01:04 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Tue Feb 7 16:01:04 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0103.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Tue Feb 7 16:01:04 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0103.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Feb 7 16:01:04 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Feb 7 16:01:04 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Feb 7 16:01:04 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Tue Feb 7 16:01:04 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Feb 7 16:01:04 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Tue Feb 7 16:01:04 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Feb 7 20:01:00 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Feb 7 20:01:00 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Feb 7 20:01:00 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Tue Feb 7 20:01:00 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Feb 7 20:01:00 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Tue Feb 7 20:01:00 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Tue Feb 7 20:01:00 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Feb 7 20:01:00 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Tue Feb 7 20:01:00 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Feb 7 20:01:00 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Tue Feb 7 20:01:00 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0104.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Tue Feb 7 20:01:00 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0104.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Feb 7 20:01:00 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Feb 7 20:01:00 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Feb 7 20:01:00 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Tue Feb 7 20:01:00 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Feb 7 20:01:00 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Tue Feb 7 20:01:00 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Feb 8 08:20:17 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 8 08:20:19 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Feb 8 08:20:19 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Wed Feb 8 08:20:19 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 8 08:20:19 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Wed Feb 8 08:20:19 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Wed Feb 8 08:20:19 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 8 08:20:19 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Wed Feb 8 08:20:19 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 8 08:20:19 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Wed Feb 8 08:20:33 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0105.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Wed Feb 8 08:20:33 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0105.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 8 08:20:33 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Feb 8 08:20:34 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 8 08:20:34 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Wed Feb 8 08:20:34 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 8 08:20:34 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Wed Feb 8 08:20:34 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Feb 8 12:02:54 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 8 12:02:54 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Feb 8 12:02:54 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Wed Feb 8 12:02:54 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 8 12:02:54 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Wed Feb 8 12:02:54 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Wed Feb 8 12:02:54 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 8 12:02:54 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Wed Feb 8 12:02:54 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 8 12:02:54 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Wed Feb 8 12:02:56 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0106.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Wed Feb 8 12:02:57 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0106.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 8 12:02:57 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Feb 8 12:02:57 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 8 12:02:57 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Wed Feb 8 12:02:57 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 8 12:02:57 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Wed Feb 8 12:02:57 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Feb 8 16:01:08 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 8 16:01:08 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Feb 8 16:01:08 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Wed Feb 8 16:01:08 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 8 16:01:08 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Wed Feb 8 16:01:08 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Wed Feb 8 16:01:08 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 8 16:01:08 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Wed Feb 8 16:01:08 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 8 16:01:08 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Wed Feb 8 16:01:08 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0107.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Wed Feb 8 16:01:08 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0107.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 8 16:01:08 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Feb 8 16:01:08 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 8 16:01:08 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Wed Feb 8 16:01:08 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 8 16:01:08 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Wed Feb 8 16:01:08 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Feb 8 20:00:54 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 8 20:00:54 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Feb 8 20:00:54 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Wed Feb 8 20:00:54 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 8 20:00:54 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Wed Feb 8 20:00:54 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Wed Feb 8 20:00:54 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 8 20:00:55 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Wed Feb 8 20:00:55 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 8 20:00:55 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Wed Feb 8 20:00:55 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0108.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Wed Feb 8 20:00:55 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0108.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 8 20:00:55 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Feb 8 20:00:55 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 8 20:00:55 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Wed Feb 8 20:00:55 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 8 20:00:55 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Wed Feb 8 20:00:55 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Thu Feb 9 08:08:17 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 9 08:08:18 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Thu Feb 9 08:08:18 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Thu Feb 9 08:08:18 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 9 08:08:18 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Thu Feb 9 08:08:18 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Thu Feb 9 08:08:18 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 9 08:08:18 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Thu Feb 9 08:08:18 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 9 08:08:18 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Thu Feb 9 08:08:20 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0109.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Thu Feb 9 08:08:21 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0109.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 9 08:08:21 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Thu Feb 9 08:08:21 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 9 08:08:21 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Thu Feb 9 08:08:21 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 9 08:08:21 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Thu Feb 9 08:08:21 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Thu Feb 9 12:02:41 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 9 12:02:41 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Thu Feb 9 12:02:41 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Thu Feb 9 12:02:41 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 9 12:02:41 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Thu Feb 9 12:02:41 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Thu Feb 9 12:02:41 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 9 12:02:41 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Thu Feb 9 12:02:41 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 9 12:02:41 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Thu Feb 9 12:02:43 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0110.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Thu Feb 9 12:02:43 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0110.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 9 12:02:43 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Thu Feb 9 12:02:43 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 9 12:02:43 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Thu Feb 9 12:02:43 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 9 12:02:43 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Thu Feb 9 12:02:43 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Thu Feb 9 16:01:09 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 9 16:01:09 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Thu Feb 9 16:01:09 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Thu Feb 9 16:01:09 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 9 16:01:09 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Thu Feb 9 16:01:09 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Thu Feb 9 16:01:09 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 9 16:01:09 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Thu Feb 9 16:01:09 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 9 16:01:09 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Thu Feb 9 16:01:09 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0111.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Thu Feb 9 16:01:09 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0111.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 9 16:01:09 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Thu Feb 9 16:01:09 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 9 16:01:09 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Thu Feb 9 16:01:09 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 9 16:01:09 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Thu Feb 9 16:01:09 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Thu Feb 9 20:01:01 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 9 20:01:01 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Thu Feb 9 20:01:01 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Thu Feb 9 20:01:01 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 9 20:01:01 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Thu Feb 9 20:01:01 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Thu Feb 9 20:01:01 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 9 20:01:01 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Thu Feb 9 20:01:01 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 9 20:01:01 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Thu Feb 9 20:01:01 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0112.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Thu Feb 9 20:01:01 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0112.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 9 20:01:01 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Thu Feb 9 20:01:01 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 9 20:01:01 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Thu Feb 9 20:01:01 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 9 20:01:01 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Thu Feb 9 20:01:01 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Feb 10 08:17:06 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Feb 10 08:17:08 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Feb 10 08:17:08 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Fri Feb 10 08:17:08 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Feb 10 08:17:08 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Fri Feb 10 08:17:08 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Fri Feb 10 08:17:08 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Feb 10 08:17:09 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Fri Feb 10 08:17:09 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Feb 10 08:17:09 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Fri Feb 10 08:17:20 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0113.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Fri Feb 10 08:17:21 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0113.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Feb 10 08:17:21 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Feb 10 08:17:21 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Feb 10 08:17:21 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Fri Feb 10 08:17:22 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Feb 10 08:17:22 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Fri Feb 10 08:17:22 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Feb 10 12:03:18 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Feb 10 12:03:18 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Feb 10 12:03:18 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Fri Feb 10 12:03:18 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Feb 10 12:03:19 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Fri Feb 10 12:03:19 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Fri Feb 10 12:03:19 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Feb 10 12:03:19 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Fri Feb 10 12:03:19 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Feb 10 12:03:19 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Fri Feb 10 12:03:20 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0114.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Fri Feb 10 12:03:20 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0114.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Feb 10 12:03:20 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Feb 10 12:03:20 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Feb 10 12:03:20 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Fri Feb 10 12:03:20 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Feb 10 12:03:20 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Fri Feb 10 12:03:20 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Feb 10 16:01:02 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Feb 10 16:01:02 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Feb 10 16:01:02 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Fri Feb 10 16:01:02 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Feb 10 16:01:02 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Fri Feb 10 16:01:02 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Fri Feb 10 16:01:02 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Feb 10 16:01:02 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Fri Feb 10 16:01:02 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Feb 10 16:01:02 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Fri Feb 10 16:01:02 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0115.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Fri Feb 10 16:01:02 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0115.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Feb 10 16:01:02 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Feb 10 16:01:02 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Feb 10 16:01:02 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Fri Feb 10 16:01:02 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Feb 10 16:01:02 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Fri Feb 10 16:01:02 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Feb 10 20:01:03 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Feb 10 20:01:05 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Feb 10 20:01:05 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Fri Feb 10 20:01:05 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Feb 10 20:01:05 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Fri Feb 10 20:01:05 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Fri Feb 10 20:01:05 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Feb 10 20:01:05 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Fri Feb 10 20:01:05 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Feb 10 20:01:05 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Fri Feb 10 20:01:05 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0116.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Fri Feb 10 20:01:05 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0116.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Feb 10 20:01:05 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Feb 10 20:01:05 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Feb 10 20:01:05 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Fri Feb 10 20:01:05 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Feb 10 20:01:05 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Fri Feb 10 20:01:05 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Feb 11 08:12:10 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Feb 11 08:12:10 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Feb 11 08:12:10 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Sat Feb 11 08:12:10 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Feb 11 08:12:10 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Sat Feb 11 08:12:10 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Sat Feb 11 08:12:10 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Feb 11 08:12:10 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Sat Feb 11 08:12:10 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Feb 11 08:12:11 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Sat Feb 11 08:12:13 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0117.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Sat Feb 11 08:12:14 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0117.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Feb 11 08:12:14 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Feb 11 08:12:14 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Feb 11 08:12:14 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sat Feb 11 08:12:14 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Feb 11 08:12:14 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sat Feb 11 08:12:14 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Feb 11 12:02:23 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Feb 11 12:02:23 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Feb 11 12:02:23 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Sat Feb 11 12:02:23 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Feb 11 12:02:23 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Sat Feb 11 12:02:23 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Sat Feb 11 12:02:23 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Feb 11 12:02:23 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Sat Feb 11 12:02:23 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Feb 11 12:02:23 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Sat Feb 11 12:02:24 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0118.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Sat Feb 11 12:02:24 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0118.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Feb 11 12:02:24 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Feb 11 12:02:25 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Feb 11 12:02:25 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sat Feb 11 12:02:25 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Feb 11 12:02:25 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sat Feb 11 12:02:25 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Feb 11 16:00:58 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Feb 11 16:00:58 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Feb 11 16:00:58 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Sat Feb 11 16:00:58 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Feb 11 16:00:58 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Sat Feb 11 16:00:58 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Sat Feb 11 16:00:58 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Feb 11 16:00:58 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Sat Feb 11 16:00:58 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Feb 11 16:00:58 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Sat Feb 11 16:00:58 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0119.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Sat Feb 11 16:00:58 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0119.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Feb 11 16:00:58 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Feb 11 16:00:58 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Feb 11 16:00:58 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sat Feb 11 16:00:58 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Feb 11 16:00:58 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sat Feb 11 16:00:58 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Feb 11 20:00:51 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Feb 11 20:00:53 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Feb 11 20:00:53 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Sat Feb 11 20:00:53 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Feb 11 20:00:53 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Sat Feb 11 20:00:53 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Sat Feb 11 20:00:53 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Feb 11 20:00:53 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Sat Feb 11 20:00:53 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Feb 11 20:00:53 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Sat Feb 11 20:00:53 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0120.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Sat Feb 11 20:00:53 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0120.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Feb 11 20:00:53 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sat Feb 11 20:00:53 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Feb 11 20:00:53 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sat Feb 11 20:00:53 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Feb 11 20:00:53 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sat Feb 11 20:00:53 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Feb 12 08:08:33 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Feb 12 08:08:34 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Feb 12 08:08:34 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Sun Feb 12 08:08:34 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Feb 12 08:08:34 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Sun Feb 12 08:08:34 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Sun Feb 12 08:08:34 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Feb 12 08:08:34 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Sun Feb 12 08:08:34 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Feb 12 08:08:34 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Sun Feb 12 08:08:38 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0121.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Sun Feb 12 08:08:39 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0121.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Feb 12 08:08:39 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Feb 12 08:08:39 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Feb 12 08:08:39 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sun Feb 12 08:08:39 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Feb 12 08:08:39 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sun Feb 12 08:08:39 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Feb 12 12:02:30 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Feb 12 12:02:30 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Feb 12 12:02:30 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Sun Feb 12 12:02:30 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Feb 12 12:02:30 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Sun Feb 12 12:02:30 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Sun Feb 12 12:02:30 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Feb 12 12:02:30 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Sun Feb 12 12:02:30 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Feb 12 12:02:30 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Sun Feb 12 12:02:32 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0122.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Sun Feb 12 12:02:32 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0122.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Feb 12 12:02:32 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Feb 12 12:02:32 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Feb 12 12:02:32 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sun Feb 12 12:02:32 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Feb 12 12:02:32 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sun Feb 12 12:02:32 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Feb 12 16:00:59 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Feb 12 16:01:01 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Feb 12 16:01:01 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Sun Feb 12 16:01:01 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Feb 12 16:01:01 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Sun Feb 12 16:01:01 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Sun Feb 12 16:01:02 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Feb 12 16:01:02 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Sun Feb 12 16:01:02 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Feb 12 16:01:02 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Sun Feb 12 16:01:02 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0123.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Sun Feb 12 16:01:02 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0123.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Feb 12 16:01:02 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Feb 12 16:01:02 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Feb 12 16:01:02 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sun Feb 12 16:01:02 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Feb 12 16:01:02 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sun Feb 12 16:01:02 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Feb 12 20:00:57 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Feb 12 20:00:57 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Feb 12 20:00:57 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Sun Feb 12 20:00:57 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Feb 12 20:00:57 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Sun Feb 12 20:00:57 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Sun Feb 12 20:00:57 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Feb 12 20:00:57 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Sun Feb 12 20:00:57 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Feb 12 20:00:57 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Sun Feb 12 20:00:57 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0124.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Sun Feb 12 20:00:57 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0124.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Feb 12 20:00:57 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Sun Feb 12 20:00:57 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Feb 12 20:00:57 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sun Feb 12 20:00:57 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Feb 12 20:00:57 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Sun Feb 12 20:00:57 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Feb 13 08:15:44 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Feb 13 08:15:47 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Feb 13 08:15:47 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Mon Feb 13 08:15:47 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Feb 13 08:15:47 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Mon Feb 13 08:15:47 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Mon Feb 13 08:15:48 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Feb 13 08:15:48 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Mon Feb 13 08:15:48 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Feb 13 08:15:48 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Mon Feb 13 08:15:59 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0125.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Mon Feb 13 08:16:00 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0125.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Feb 13 08:16:01 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Feb 13 08:16:01 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Feb 13 08:16:01 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Mon Feb 13 08:16:01 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Feb 13 08:16:01 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Mon Feb 13 08:16:01 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Feb 13 12:02:43 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Feb 13 12:02:43 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Feb 13 12:02:43 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Mon Feb 13 12:02:43 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Feb 13 12:02:43 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Mon Feb 13 12:02:43 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Mon Feb 13 12:02:43 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Feb 13 12:02:43 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Mon Feb 13 12:02:43 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Feb 13 12:02:44 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Mon Feb 13 12:02:45 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0126.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Mon Feb 13 12:02:45 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0126.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Feb 13 12:02:45 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Feb 13 12:02:45 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Feb 13 12:02:45 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Mon Feb 13 12:02:45 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Feb 13 12:02:45 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Mon Feb 13 12:02:45 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Feb 13 16:01:15 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Feb 13 16:01:15 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Feb 13 16:01:15 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Mon Feb 13 16:01:15 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Feb 13 16:01:15 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Mon Feb 13 16:01:15 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Mon Feb 13 16:01:15 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Feb 13 16:01:15 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Mon Feb 13 16:01:15 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Feb 13 16:01:15 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Mon Feb 13 16:01:15 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0127.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Mon Feb 13 16:01:15 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0127.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Feb 13 16:01:15 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Feb 13 16:01:15 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Feb 13 16:01:15 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Mon Feb 13 16:01:15 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Feb 13 16:01:15 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Mon Feb 13 16:01:15 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Feb 13 20:00:56 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Feb 13 20:00:56 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Feb 13 20:00:56 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Mon Feb 13 20:00:56 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Feb 13 20:00:56 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Mon Feb 13 20:00:56 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Mon Feb 13 20:00:56 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Feb 13 20:00:56 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Mon Feb 13 20:00:56 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Feb 13 20:00:56 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Mon Feb 13 20:00:56 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0128.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Mon Feb 13 20:00:56 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0128.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Feb 13 20:00:56 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Mon Feb 13 20:00:56 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Feb 13 20:00:56 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Mon Feb 13 20:00:56 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Feb 13 20:00:56 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Mon Feb 13 20:00:56 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Feb 14 08:17:47 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Feb 14 08:17:48 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Feb 14 08:17:49 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Tue Feb 14 08:17:49 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Feb 14 08:17:49 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Tue Feb 14 08:17:50 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Tue Feb 14 08:17:50 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Feb 14 08:17:50 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Tue Feb 14 08:17:50 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Feb 14 08:17:50 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Tue Feb 14 08:17:54 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0129.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Tue Feb 14 08:17:56 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0129.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Feb 14 08:17:56 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Feb 14 08:17:56 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Feb 14 08:17:56 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Tue Feb 14 08:17:56 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Feb 14 08:17:56 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Tue Feb 14 08:17:56 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Feb 14 12:03:01 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Feb 14 12:03:01 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Feb 14 12:03:01 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Tue Feb 14 12:03:01 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Feb 14 12:03:01 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Tue Feb 14 12:03:02 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Tue Feb 14 12:03:02 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Feb 14 12:03:02 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Tue Feb 14 12:03:02 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Feb 14 12:03:02 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Tue Feb 14 12:03:05 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0130.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Tue Feb 14 12:03:05 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0130.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Feb 14 12:03:05 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Feb 14 12:03:05 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Feb 14 12:03:05 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Tue Feb 14 12:03:05 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Feb 14 12:03:05 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Tue Feb 14 12:03:05 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Feb 14 16:01:19 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Feb 14 16:01:20 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Feb 14 16:01:20 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Tue Feb 14 16:01:20 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Feb 14 16:01:20 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Tue Feb 14 16:01:20 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Tue Feb 14 16:01:20 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Feb 14 16:01:20 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Tue Feb 14 16:01:20 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Feb 14 16:01:20 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Tue Feb 14 16:01:20 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0131.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Tue Feb 14 16:01:20 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0131.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Feb 14 16:01:20 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Feb 14 16:01:20 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Feb 14 16:01:20 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Tue Feb 14 16:01:20 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Feb 14 16:01:20 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Tue Feb 14 16:01:20 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Feb 14 20:01:02 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Feb 14 20:01:02 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Feb 14 20:01:02 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Tue Feb 14 20:01:02 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Feb 14 20:01:02 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Tue Feb 14 20:01:02 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Tue Feb 14 20:01:02 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Feb 14 20:01:02 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Tue Feb 14 20:01:02 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Feb 14 20:01:02 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Tue Feb 14 20:01:02 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0132.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Tue Feb 14 20:01:02 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0132.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Feb 14 20:01:02 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Tue Feb 14 20:01:02 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Feb 14 20:01:02 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Tue Feb 14 20:01:02 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Tue Feb 14 20:01:02 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Tue Feb 14 20:01:02 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Feb 15 08:23:54 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 15 08:23:57 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Feb 15 08:23:57 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Wed Feb 15 08:23:57 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 15 08:23:57 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Wed Feb 15 08:23:58 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Wed Feb 15 08:23:58 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 15 08:23:58 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Wed Feb 15 08:23:58 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 15 08:23:58 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Wed Feb 15 08:24:20 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0133.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Wed Feb 15 08:24:26 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0133.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 15 08:24:26 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Feb 15 08:24:26 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 15 08:24:26 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Wed Feb 15 08:24:26 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 15 08:24:27 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Wed Feb 15 08:24:27 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Feb 15 12:04:52 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 15 12:04:52 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Feb 15 12:04:52 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Wed Feb 15 12:04:53 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 15 12:04:53 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Wed Feb 15 12:04:53 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Wed Feb 15 12:04:53 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 15 12:04:53 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Wed Feb 15 12:04:53 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 15 12:04:53 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Wed Feb 15 12:04:55 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0134.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Wed Feb 15 12:04:56 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0134.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 15 12:04:56 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Feb 15 12:04:56 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 15 12:04:56 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Wed Feb 15 12:04:56 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 15 12:04:56 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Wed Feb 15 12:04:56 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Feb 15 16:01:25 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 15 16:01:26 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Feb 15 16:01:26 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Wed Feb 15 16:01:26 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 15 16:01:26 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Wed Feb 15 16:01:26 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Wed Feb 15 16:01:26 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 15 16:01:26 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Wed Feb 15 16:01:26 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 15 16:01:26 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Wed Feb 15 16:01:26 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0135.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Wed Feb 15 16:01:26 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0135.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 15 16:01:26 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Feb 15 16:01:26 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 15 16:01:26 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Wed Feb 15 16:01:26 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 15 16:01:26 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Wed Feb 15 16:01:26 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Feb 15 19:27:58 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 15 19:27:58 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Feb 15 19:27:58 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Wed Feb 15 19:27:58 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 15 19:27:58 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Wed Feb 15 19:27:58 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Wed Feb 15 19:27:58 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 15 19:27:58 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Wed Feb 15 19:27:58 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 15 19:27:58 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Wed Feb 15 19:27:58 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0136.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Wed Feb 15 19:27:58 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0136.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 15 19:27:58 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Feb 15 19:27:58 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 15 19:27:58 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Wed Feb 15 19:27:58 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 15 19:27:58 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Wed Feb 15 19:27:58 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Feb 15 20:12:25 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 15 20:12:26 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Feb 15 20:12:26 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Wed Feb 15 20:12:26 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 15 20:12:26 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Wed Feb 15 20:12:26 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Wed Feb 15 20:12:26 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 15 20:12:26 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Wed Feb 15 20:12:26 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 15 20:12:26 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Wed Feb 15 20:12:29 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0137.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Wed Feb 15 20:12:29 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0137.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 15 20:12:29 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Wed Feb 15 20:12:29 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 15 20:12:29 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Wed Feb 15 20:12:29 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Feb 15 20:12:30 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Wed Feb 15 20:12:30 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Thu Feb 16 08:42:50 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 16 08:42:52 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Thu Feb 16 08:42:52 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Thu Feb 16 08:42:52 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 16 08:42:52 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Thu Feb 16 08:42:52 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Thu Feb 16 08:42:52 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 16 08:42:52 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Thu Feb 16 08:42:52 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 16 08:42:53 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Thu Feb 16 08:43:14 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0138.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Thu Feb 16 08:43:20 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0138.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 16 08:43:20 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Thu Feb 16 08:43:20 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 16 08:43:21 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Thu Feb 16 08:43:21 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Feb 16 08:43:21 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Thu Feb 16 08:43:21 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ... From zxo102 at yahoo.com Sat Oct 5 11:52:44 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Mar 31 16:33:16 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? Message-ID: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Hi All: I just start to use mxODBC and have no problem to fetch records from a table via ODBC in windows using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC? Does anyone know how to get it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Sat Oct 5 22:29:15 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Mar 31 16:33:16 2006 Subject: [egenix-users] How to get a list of table names via ODBC in Windows using mxODBC? References: <20021005175244.93806.qmail@web10803.mail.yahoo.com> Message-ID: <3D9F3D8B.8050600@lemburg.com> zhihua ouyang wrote: > Hi All: > I just start to use mxODBC and have no problem to > fetch records from a table via ODBC in windows using > mxODBC. But I don't know how to get a list of table > names for a given database via ODBC in Windows using > mxODBC? Does anyone know how to get it? > > Thanks very much in advance. The .tables() catalog method will give you this information: """ Catalog Methods Catalog methods allow you to access meta-level and structural information about a data source in a (more-or-less) portable way. Please note that these methods are extensions to the DB API standard. Also, some ODBC drivers to not support all of these methods or return unusable data. As a result, you should verify correct operation for your target data sources prior to relying on these methods. All of the following catalog methods use the same interface: they do an implicit call to cursor.execute() and return their output in form of a list of rows which that can be fetched with the fetchXXX() methods in the usual way. The methods always return the number of rows in the result set. Please refer to the ODBC documentation for more detailed information about parameters (if you pass None as a value where a string would be expected, that entry is converted to NULL before passing it to the underlying ODBC API) and the layout of the result sets. Notes: The result set layouts described here may not apply to your data source. Some databases do not provide all the information given here and thus generate slightly different result sets; expect column omissions or additions. All catalog methods support keywords and use the indicated default values for parameters which are omitted in the call. IMPORTANT: The search patterns given as parameters to these catalog methods are usually interpreted in a case-sensitive way. This means that even if the database itself behaves case-insensitive for identifiers, you may still not find what you're looking for if you don't use the case which the database internally uses to store the identifier. As an example take the SAP DB: it stores all unquoted identifiers using uppercase letters. Trying to fetch e.g. information about a table using a lowercase version of the name will result in an empty result set. You can use connection.getinfo(SQL.IDENTIFIER_CASE) to determine how the database stores identifiers. See the ODBC documentation for details. .tables(qualifier=None, owner=None, table=None, type=None) Catalog method which generates a result set having the following schema: Column Name Column Datatype Comment TABLE_CAT VARCHAR(128) The name of the catalog containing TABLE_SCHEM. This column contains a NULL value. TABLE_SCHEM VARCHAR(128) The name of the schema containing TABLE_NAME. TABLE_NAME VARCHAR(128) The name of the table, or view, or alias, or synonym. TABLE_TYPE VARCHAR(128) Identifies the type given by the name in the TABLE_NAME column. It can have the string values "TABLE", "VIEW", "INOPERATIVE VIEW", "SYSTEM TABLE", "ALIAS", or "SYNONYM". REMARKS VARCHAR(254) Contains the descriptive information about the table. """ See the Microsoft ODBC site for the ODBC documentation. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Sat Oct 5 11:38:08 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Mar 31 16:33:16 2006 Subject: [egenix-users] How to get a list of table names via ODBC in windows using mxODBC? Message-ID: <20021005173808.82754.qmail@web10804.mail.yahoo.com> Hi all: I just start to use mxODBC in Windows and have no problem to get records from a table via ODBC in Windows Using mxODBC. But I don't know how to get a list of table names for a given database via ODBC in Windows using mxODBC. Does anybody know how to do it? Thanks very much in advance. Zhihua Ouyang __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From gashton at cmedltd.com Tue Oct 8 13:13:00 2002 From: gashton at cmedltd.com (Graham Ashton) Date: Fri Mar 31 16:33:16 2006 Subject: [egenix-users] Date conversion weirdness Message-ID: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Hi. Can anybody explain what is happening here, and how I should get round it? % python Python 2.2 (#2, Mar 11 2002, 13:24:00) [GCC 2.95.3 20010315 (release)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2.strftime('%d-%b-%Y') '22-Jun-1971' I was expecting 23-Jun-1971 to pop out of the end of there. It doesn't happen for most dates, but seems to be a problem for a significant portion of 1971! -- Graham Ashton From mal at lemburg.com Tue Oct 8 14:18:24 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Mar 31 16:33:16 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <3DA2BF00.2010605@lemburg.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>from mx.DateTime import DateTime, gmtime >>>>dt = DateTime(1971, 06, 23) >>>>dt2 = gmtime(dt) >>>>dt2.strftime('%d-%b-%Y') > > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. The outcome depends on your local time zone: >>> dt = DateTime(1971, 06, 23) >>> dt >>> gmtime(dt) (this is GMT+1) > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From sholden at holdenweb.com Tue Oct 8 09:14:42 2002 From: sholden at holdenweb.com (Steve Holden) Date: Fri Mar 31 16:33:16 2006 Subject: [egenix-users] Date conversion weirdness References: <1034075580.21223.23.camel@ratchet.cambridge.cmedltd.com> Message-ID: <01b701c26ec4$49588aa0$6300000a@holdenweb.com> Graham Ashton wrote: > Hi. Can anybody explain what is happening here, and how I should get > round it? > > % python > Python 2.2 (#2, Mar 11 2002, 13:24:00) > [GCC 2.95.3 20010315 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from mx.DateTime import DateTime, gmtime > >>> dt = DateTime(1971, 06, 23) > >>> dt2 = gmtime(dt) > >>> dt2.strftime('%d-%b-%Y') > '22-Jun-1971' > > I was expecting 23-Jun-1971 to pop out of the end of there. > > It doesn't happen for most dates, but seems to be a problem for a > significant portion of 1971! > Strange. I wonder if this is dependent on your time zone? Or perhaps your mxDateTime version? It works for me both under Cygwin (shown below) and vanillla Windows Python 2.2. Python 2.2.1 (#1, Jun 25 2002, 10:55:46) [GCC 2.95.3-5 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx.DateTime import DateTime, gmtime >>> dt = DateTime(1971, 06, 23) >>> dt2 = gmtime(dt) >>> dt2 >>> dt2.strftime('%d-%b-%Y') '23-Jun-1971' >>> regards ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Previous .sig file retired to www.homeforoldsigs.com ----------------------------------------------------------------------- From yelled at yahoo.com Tue Oct 15 09:59:19 2002 From: yelled at yahoo.com (S. Hoon Yoon) Date: Fri Mar 31 16:33:16 2006 Subject: [egenix-users] Solaris Compile problem Message-ID: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Hi: I am trying to install mxDateTime package on Solaris and getting a strange message that I do not understand. Any thoughts will be very much appreciated. TIA, Hoon, ---------------------------------------------- { 14 } --> uname -a SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 --------------Here's the error message-------- bash-2.03$ python setup.py install running install running build running mx_autoconf macros to define: [] macros to undefine: [] updated build_ext with autoconf setup running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 -I/usr/include -I/usr/local/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o In file included from mx/DateTime/mxDateTime/mx.h:51, from mx/DateTime/mxDateTime/mxDateTime.c:41: mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared (first use in this function) mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is reported only once mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears in.) mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 15 22:08:57 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Mar 31 16:33:16 2006 Subject: [egenix-users] Solaris Compile problem References: <20021015155919.38399.qmail@web11608.mail.yahoo.com> Message-ID: <3DAC67C9.2020208@lemburg.com> S. Hoon Yoon wrote: > Hi: > > I am trying to install mxDateTime package on Solaris and getting a > strange message that I do not understand. Any thoughts will be very > much appreciated. Funny, this is the second time I'm getting this kind of bug report on Solaris. The solution is simple: * The extensions don't compile on Solaris. What can I do ? If you are using gcc to compile the extensions, then a likely cause is that the compiler is picking up non-gcc compatible include files. E.g. on some Solaris installations, the /usr/include directory contains a file stdarg.h which the gcc compiler normally provides in its own compiler specific include directories. Since the distutils setup adds /usr/include to the standard lookup path for include files, gcc picks up this incompatbile file and generates an error. The work-around is easy: edit mxSetup.py and remove the '/usr/include' entry from the tuple INCLPATH. Now, since this seems to be a common "bug", could you give me the value of sys.platform for Solaris. I'll then add a test to mxSetup.py which prevents adding /usr/include to the include path. > TIA, > > Hoon, > ---------------------------------------------- > { 14 } --> uname -a > SunOS njtra79 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-100 > --------------Here's the error message-------- > bash-2.03$ python setup.py install > running install > running build > running mx_autoconf > macros to define: [] > macros to undefine: [] > updated build_ext with autoconf setup > running build_ext > > building extension "mx.DateTime.mxDateTime.mxDateTime" (required) > building 'mx.DateTime.mxDateTime.mxDateTime' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -Imx/DateTime/mxDateTime -I/home/nite/Python/include/python2.2 > -I/usr/include -I/usr/local/include -c > mx/DateTime/mxDateTime/mxDateTime.c -o > build/temp.solaris-2.8-sun4u-2.2/mx/DateTime/mxDateTime/mxDateTime/mxDateTime.o > In file included from mx/DateTime/mxDateTime/mx.h:51, > from mx/DateTime/mxDateTime/mxDateTime.c:41: > mx/DateTime/mxDateTime/mxstdlib.h: In function `mxDebugPrintf': > mx/DateTime/mxDateTime/mxstdlib.h:192: `__builtin_va_alist' undeclared > (first use in this function) > mx/DateTime/mxDateTime/mxstdlib.h:192: (Each undeclared identifier is > reported only once > mx/DateTime/mxDateTime/mxstdlib.h:192: for each function it appears > in.) > mx/DateTime/mxDateTime/mxstdlib.h:150: warning: `args' might be used > uninitialized in this function > error: command 'gcc' failed with exit status 1 > > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fuess at llnl.gov Thu Oct 17 09:50:50 2002 From: fuess at llnl.gov (David A. Fuess) Date: Fri Mar 31 16:33:16 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection Message-ID: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Dear list members, I am new to mxODBC (in the trial period to see if it will work for us). The need is to connect to an Oracle instance on a Sun computer from a web server running IIS 5.0 under Win2k. I have installed and tested the Oracle Client tools and updated the Oracle ODBC driver to the latest version. I installed mxODBC under Python 2.2.1 and tested successfully using a locally run script in Pythonwin. So, at least at some level, I know all of the interfaces work. The problem arises when I attempt to run the connection from a CGI under IIS 5.0 (I am actually running it in an ASP with language=Python). The error I get is: OperationalError: ('IM003',160,'Specified driver could not be loaded due to system error 5', 6038) It appears that mx.ODBC.Windows is loading properly and the error is generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear to load properly (although I have not checked them all). Suggestions? Thanks in advance, Dave David A. Fuess Lawrence Livermore National Laboratory 925-423-2436 fuess@llnl.gov From mal at lemburg.com Thu Oct 17 19:29:41 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Mar 31 16:33:17 2006 Subject: [egenix-users] New user woes, Oracle/IIS/ASP connection References: <5.0.2.1.2.20021017083746.022e38a0@popcorn.llnl.gov> Message-ID: <3DAEE575.8080007@lemburg.com> David A. Fuess wrote: > Dear list members, > > I am new to mxODBC (in the trial period to see if it will work for us). > The need is to connect to an Oracle instance on a Sun computer from a > web server running IIS 5.0 under Win2k. I have installed and tested the > Oracle Client tools and updated the Oracle ODBC driver to the latest > version. I installed mxODBC under Python 2.2.1 and tested successfully > using a locally run script in Pythonwin. So, at least at some level, I > know all of the interfaces work. The problem arises when I attempt to > run the connection from a CGI under IIS 5.0 (I am actually running it in > an ASP with language=Python). The error I get is: > > OperationalError: ('IM003',160,'Specified driver could not be loaded due > to system error 5', 6038) > > It appears that mx.ODBC.Windows is loading properly and the error is > generating from mx.ODBC.Windows.DriverConnect(). Other mx. appear > to load properly (although I have not checked them all). > > Suggestions? Google gives these answers: * http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q299454 (for ODBC on Windows in general, see: http://www.kbalertz.com/allKbs.aspx?tec=99) * http://sage.is.makingithappen.co.uk/tech/posts/148.html * http://www.orafaq.com/msgboard/webserver/messages/1681.htm It sounds like a permissions problem on the server. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From R.Buchanan at comcast.net Fri Oct 18 09:33:49 2002 From: R.Buchanan at comcast.net (Bob Buchanan) Date: Fri Mar 31 16:33:18 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt Message-ID: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> I keep getting 'Invalid syntax' when I try the following insert statement: c.execute('insert into Table1 (SSN, Field1) values ('44', 'mxPerson')') Can you tell me why? I'm using mxODBC to insert into an MSAccess db. Where can I find documentation for mxODBC? The information contained on www.egenix.com/files/python/mxODBC.html is not detailed enough. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/d204ee0a/attachment-0139.htm From Jim.Vickroy at noaa.gov Fri Oct 18 09:09:23 2002 From: Jim.Vickroy at noaa.gov (Jim Vickroy) Date: Fri Mar 31 16:33:18 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB01613.B56971B@noaa.gov> Bob, This is a standard Python error message; it has nothing to do with mx.ODBC. Try: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Note the outer string delimiters are quotation marks (") instead of apostrophe marks ('). The reason for the use of " is because your SQL statement, itself, contains '. Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the following insert > statement: > c.execute('insert into Table1 (SSN, Field1) values ('44', > 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert into an MSAccess db. > > > Where can I find documentation for mxODBC? The information contained > on > www.egenix.com/files/python/mxODBC.html > is not detailed > enough. > > Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20021018/5dd377db/attachment-0139.htm From mal at lemburg.com Fri Oct 18 18:24:43 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Mar 31 16:33:18 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt References: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <3DB027BB.8030609@lemburg.com> Bob Buchanan wrote: > Where can I find documentation for mxODBC? The information contained on > www.egenix.com/files/python/mxODBC.html > > is not detailed enough. mxODBC is Python DB-API compliant. Here's the specification for the DB API 2.0: http://www.python.org/peps/pep-0249.html Other sources of information are many of the Python books which include a database chapter (e.g. the Win32 book by Mark Hammond and Andy Robinson) as well as other resources on the web: Paul Boddie's mxODBC configuration guide: http://www.boddie.org.uk/python/mxODBC.html The Python Database Topic Guide: http://www.python.org/topics/database/ and the talk I gave at EuroPython 2002 about the Python DB API: http://www.egenix.com/Python-Database-API-Talk.pdf -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From zxo102 at yahoo.com Fri Oct 18 11:47:00 2002 From: zxo102 at yahoo.com (zhihua ouyang) Date: Fri Mar 31 16:33:19 2006 Subject: [egenix-users] Invalid Syntax for Insert stmt In-Reply-To: <006401c276a2$9c4d5b10$6601a8c0@bankofamerica.com> Message-ID: <20021018174700.54106.qmail@web10805.mail.yahoo.com> Try this: c.execute("insert into Table1 (SSN, Field1) values ('44', 'mxPerson')") Ouyang --- Bob Buchanan wrote: > I keep getting 'Invalid syntax' when I try the > following insert statement: > c.execute('insert into Table1 (SSN, Field1) values > ('44', 'mxPerson')') > > Can you tell me why? I'm using mxODBC to insert > into an MSAccess db. > > > Where can I find documentation for mxODBC? The > information contained on > www.egenix.com/files/python/mxODBC.html > is > not detailed enough. > > Thanks in advance for your help. > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From mal at lemburg.com Tue Oct 22 11:25:16 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Mar 31 16:33:19 2006 Subject: [egenix-users] Re: help mx install References: <003201c2794a$c1dfb6c0$e8f003ca@y6mhs> Message-ID: <3DB50B6C.5030600@lemburg.com> [CCing to egenix-users, because this may be useful for others as well] direction landsnet wrote: > Hi Marc-Andre, > > I want to install your *eGenix.com mx BASE Package* > , > because I use CalendarTag2.0alpha2 et mxDateTime-0.3.0. I must work on > Windoxs 98... > > You wrote: > > On *Windows platforms* the preferred method for installation is using > the the Windows installer, since this doesn't require a C compiler to be > installed on the system. Thanks to Thomas Heller the installer also > support uninstall using the standard Windows uninstall procedure. > > > But when I launch egenix-mx-base-2.0.4.win32-py2.1.exe, I have an error > message: > "Python 2.1 version required, which was not found in the registry". > > I have python.exe and python21.dll in C:\Program Files\ZOPE2.5.1CPS\bin. > > What is the problem? A PATH problem? Where I can modify the PATH variable? > Thank you in advance for your response. No, the problem is that the Python installation in Zope does not put itself in the Windows registry. To install the base package, simply open the installer .exe in WinZIP (yes, this works :-) and extract the files to /lib/python/. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 14:25:01 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Fri Mar 31 16:33:19 2006 Subject: [egenix-users] Has the gmtoffset return value changed? Message-ID: <3DBC3D8D.5050803@rogers.com> I have a little module "sunriseset.py" that calculates (strangely enough) sun rise and set times, and which was working fine with older versions of mxDateTime. However, this morning I received a bug report that it's no longer working. As far as I know there have been no changes to the module itself, and prior to this (when I checked it many months ago) its self-check passed fine. That would have been with an earlier mxDateTime release. I have, of course, since updated mxDateTime when I updated mxTextTools. The thing is, now the reported values from gmtoffset appear to have been reversed in sign (that is, what was 5h is now -5h). Obviously the sign is always just an arbitrary choice (hence the need to declare which direction increases/decreases in specifications of time systems), but I'm surprised that it would have changed sign between releases of the mxDateTime library. Anyway, I can work around this if I know which versions of mxDateTime return positive, and which negative, values for the same time-zones (i.e. when the switch occurs). Marc-Andr?, anyone? Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ From mal at lemburg.com Sun Oct 27 22:39:55 2002 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Mar 31 16:33:19 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> Message-ID: <3DBC5D2B.4060800@lemburg.com> Mike C. Fletcher wrote: > I have a little module "sunriseset.py" that calculates (strangely > enough) sun rise and set times, and which was working fine with older > versions of mxDateTime. However, this morning I received a bug report > that it's no longer working. As far as I know there have been no > changes to the module itself, and prior to this (when I checked it many > months ago) its self-check passed fine. That would have been with an > earlier mxDateTime release. > > I have, of course, since updated mxDateTime when I updated mxTextTools. > The thing is, now the reported values from gmtoffset appear to have been > reversed in sign (that is, what was 5h is now -5h). -5h is the correct value in your locale (that's also what your mail client reports as GMT offset): The UTC offset is defined as: local time - UTC time, e.g. it is negative in the US and positive in eastern Europe and Asia. > Obviously the sign > is always just an arbitrary choice (hence the need to declare which > direction increases/decreases in specifications of time systems), but > I'm surprised that it would have changed sign between releases of the > mxDateTime library. > > Anyway, I can work around this if I know which versions of mxDateTime > return positive, and which negative, values for the same time-zones > (i.e. when the switch occurs). Marc-Andr?, anyone? I am not aware that there were any changes in the sign. Are you sure that mxDateTime returned 5h for you in some prior version ? And if so, which versions are you comparing and on which platform ? -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mcfletch at rogers.com Sun Oct 27 17:22:28 2002 From: mcfletch at rogers.com (Mike C. Fletcher) Date: Fri Mar 31 16:33:19 2006 Subject: [egenix-users] Has the gmtoffset return value changed? References: <3DBC3D8D.5050803@rogers.com> <3DBC5D2B.4060800@lemburg.com> Message-ID: <3DBC6724.9030005@rogers.com> Urgh. I dug out some old versions of mxDateTime, and as you say, they haven't changed... darned if I can figure out how the sign got reversed in my module, but apparently it did at some point in time :( . Should really get this thing into CVS so I can see the changes. Sigh. Sorry to have bothered everyone with this. Thanks Marc-Andr?, Mike M.-A. Lemburg wrote: > Mike C. Fletcher wrote: > -5h is the correct value in your locale (that's also what your > mail client reports as GMT offset): > > The UTC offset is defined as: local time - UTC time, > e.g. it is negative in the US and positive in eastern > Europe and Asia. ...