From djc@object-craft.com.au Wed May 2 01:04:23 2001 From: djc@object-craft.com.au (Dave Cole) Date: 02 May 2001 10:04:23 +1000 Subject: [DB-SIG] Connection of MS SQL Residing in Microsoft NT with Python Residing in Linux In-Reply-To: "Kang Se Yan"'s message of "Mon, 30 Apr 2001 18:12:46 +0800" References: Message-ID: >>>>> "Kang" == Kang Se Yan writes: Kang> Dear Everbody, I am have a problem in how a Python residing in Kang> Linux platform communicates with a MS SQL which is resided at Kang> Windows NT. Thank you for your help. The module that I wrote for Sybase can be installed on Linux and can talk to an MS SQL server. http://www.object-craft.com.au/projects/sybase/ Try the module rewrite first: http://www.object-craft.com.au/projects/sybase/Sybase-0.23.tar.gz The rewrite is not complete - although it is pretty close. If that does not work, try the old pure C module: http://www.object-craft.com.au/projects/sybase/Sybase-0.13.tar.gz - Dave -- http://www.object-craft.com.au From djc@object-craft.com.au Wed May 2 01:04:23 2001 From: djc@object-craft.com.au (Dave Cole) Date: 02 May 2001 10:04:23 +1000 Subject: [DB-SIG] Connection of MS SQL Residing in Microsoft NT with Python Residing in Linux In-Reply-To: "Kang Se Yan"'s message of "Mon, 30 Apr 2001 18:12:46 +0800" References: Message-ID: >>>>> "Kang" == Kang Se Yan writes: Kang> Dear Everbody, I am have a problem in how a Python residing in Kang> Linux platform communicates with a MS SQL which is resided at Kang> Windows NT. Thank you for your help. The module that I wrote for Sybase can be installed on Linux and can talk to an MS SQL server. http://www.object-craft.com.au/projects/sybase/ Try the module rewrite first: http://www.object-craft.com.au/projects/sybase/Sybase-0.23.tar.gz The rewrite is not complete - although it is pretty close. If that does not work, try the old pure C module: http://www.object-craft.com.au/projects/sybase/Sybase-0.13.tar.gz - Dave -- http://www.object-craft.com.au _______________________________________________ DB-SIG maillist - DB-SIG@python.org http://mail.python.org/mailman/listinfo/db-sig From kjcole@gri.gallaudet.edu Wed May 2 16:01:51 2001 From: kjcole@gri.gallaudet.edu (Kevin Cole) Date: Wed, 2 May 2001 11:01:51 -0400 (EDT) Subject: [DB-SIG] Anyone successfully using cursors w/ Python & PostgreSQL RPM's? In-Reply-To: Message-ID: Hi, A few weeks ago, I was exchanging e-mail with the developers of the PostgreSQL hooks into Python. I downloaded the latest stable PostgreSQL source RPM from www.postgresql.org, and installed from those. According to the web pages, and the folks I exchanged e-mail with, I should have ended up with a "pgdb.py". I didn't. The suggestion was then made to use the tarball instead, but that appeared to produce the same results. Anyone else have the right combination of bits? Should I be using the LATEST latest (beyond the stable version)? If at all possible, I'd prefer to stick with the RPM's cuz I like being able to query the RPM database for details about the who, what, where, when, which and why of a package. -- Kevin Cole, RHCE, Linux Admin | E-mail: kjcole@gri.gallaudet.edu Gallaudet Research Institute | WWW: http://gri.gallaudet.edu/~kjcole/ Hall Memorial Bldg S-419 | Voice: (202) 651-5135 Washington, D.C. 20002-3695 | FAX: (202) 651-5746 From stuart@sharinga.com Thu May 3 05:57:04 2001 From: stuart@sharinga.com (Stuart Bishop) Date: Thu, 3 May 2001 14:57:04 +1000 Subject: [DB-SIG] PEP249 - Proposed change to DB-API 2.0 In-Reply-To: <3AE95705.38D5CF25@lemburg.com> Message-ID: > > [Making the DB API interface handle multiple paramstyles] > > > > How about specifying a single 'python meta' -style. So the module > > writers would support the database native format, and the Python DB-Api > > format, from which a conversion to native format would exist. I spent > > maybe 2 minutes thinking about it, so maybe this is not feasible, just a > > thought... > > This is not necessarily efficient, e.g. MySQL and Postgresql are > just fine with wrapping data up in the SQL statement itself, > but e.g. many ODBC drivers pass in data using column binding and > only parse the SQL once (parsing and checking for correctness > takes a long time...) ! > > I'd rather leave it at the current open state of affairs. People who > want to use a generic interface can use wrappers or Chris' dbhelper.py > module if they want to. If there is need of a PEP, it would be to have one of the wrappers formalized and included in the standard python distribution. Adding Gadfly in as the default driver would be an added bonus for a variety of reasons, not the least oneupmanship with most other languages :-) From nallaraja@rediffmail.com Fri May 4 07:01:40 2001 From: nallaraja@rediffmail.com (nalla raja) Date: 4 May 2001 06:01:40 -0000 Subject: [DB-SIG] doubt on python db connection Message-ID: <20010504060140.18150.qmail@mailweb8.rediffmail.com> Sir, I would like to get these details from you regarding python and db. 1. what is the syntax for connecting db to python.. 2. can we connect sqlserver to python.. looking forward to your reply.. regards, nallaraja. _____________________________________________________ Chat with your friends as soon as they come online. Get Rediff Bol at http://bol.rediff.com From nallaraja@rediffmail.com Fri May 4 07:01:40 2001 From: nallaraja@rediffmail.com (nalla raja) Date: 4 May 2001 06:01:40 -0000 Subject: [DB-SIG] doubt on python db connection Message-ID: <20010504060140.18150.qmail@mailweb8.rediffmail.com> Sir, I would like to get these details from you regarding python and db. 1. what is the syntax for connecting db to python.. 2. can we connect sqlserver to python.. looking forward to your reply.. regards, nallaraja. _____________________________________________________ Chat with your friends as soon as they come online. Get Rediff Bol at http://bol.rediff.com From nallaraja@rediffmail.com Sat May 5 09:56:27 2001 From: nallaraja@rediffmail.com (nalla raja) Date: 5 May 2001 08:56:27 -0000 Subject: [DB-SIG] hi Message-ID: <20010505085627.27313.qmail@mailweb9.rediffmail.com> hi!!! I started to learn python. how do i connect python to ORACLE. only connection object is enough or and modules do i need to write ... looking forward to ur reply... Regards, nallaraja. Nallaraja. _____________________________________________________ Chat with your friends as soon as they come online. Get Rediff Bol at http://bol.rediff.com From nallaraja@rediffmail.com Sat May 5 09:56:27 2001 From: nallaraja@rediffmail.com (nalla raja) Date: 5 May 2001 08:56:27 -0000 Subject: [DB-SIG] hi Message-ID: <20010505085627.27313.qmail@mailweb9.rediffmail.com> hi!!! I started to learn python. how do i connect python to ORACLE. only connection object is enough or and modules do i need to write ... looking forward to ur reply... Regards, nallaraja. Nallaraja. _____________________________________________________ Chat with your friends as soon as they come online. Get Rediff Bol at http://bol.rediff.com From Andreas Jung" Message-ID: <006201c0d63a$9de63190$0d0b0a0a@SUXLAP> http://www.zope.org/Members/matt/dco2/ ----- Original Message ----- From: "nalla raja" To: Sent: Saturday, May 05, 2001 4:56 AM Subject: [DB-SIG] hi > hi!!! > > I started to learn python. > how do i connect python to ORACLE. > only connection object is enough or > and modules do i need to write ... > looking forward to ur reply... > > Regards, > nallaraja. > Nallaraja. > > _____________________________________________________ > Chat with your friends as soon as they come online. Get Rediff Bol at > http://bol.rediff.com > > > > > > _______________________________________________ > DB-SIG maillist - DB-SIG@python.org > http://mail.python.org/mailman/listinfo/db-sig From djc@object-craft.com.au Mon May 7 05:41:04 2001 From: djc@object-craft.com.au (Dave Cole) Date: 07 May 2001 14:41:04 +1000 Subject: [DB-SIG] Sybase module 0.24 (Timothy Docker release) released Message-ID: What is it: The Sybase module provides a Python interface to the Sybase relational database system. The Sybase package supports almost all of the Python Database API, version 2.0 with extensions. The module works with Python versions 1.5.2 and later and Sybase versions 11.0.3 and later. It is based on the Sybase Client Library (ct_* API), and the Bulk-Library Client (blk_* API) interfaces. The 0.20 and later releases are a reimplementation of the module using a thin C wrapper on the Sybase-CT API, and a Python module to provide the DB-API functionality. It is still a work in progress, but should be good enough for most purposes. Timothy Docker sent a patch with the following changes: - con.c renamed to conn.c because NT still has the CON: device!!! - warnings from gcc -Wall fixed. - bug fix in CS_BLKDESC_blk_init() - missing & operator. - bug fix in CS_CONNECTION_ct_diag, CS_CONTEXT_cs_diag() - missing return NULL. - bug fixes to raise exception for unhandled properties in sybasect module. - ARRAY_INSERT now controlled by HAS_ARRAY_INSERT in sybasect.h - Initialisation via PyObject_HEAD_INIT() now conforms to example module in Python distribution. It should be possible to compile and install on NT. - rename max() macro to maxv() in numeric.c - created initial setup.py and ntsetup.py for use with distutils. Now you can just run the following command to install: bash$ python setup.py install Or on NT: > python ntsetup.py install Where can you get it: http://www.object-craft.com.au/projects/sybase/ - Dave -- http://www.object-craft.com.au From matthew.cahn@bms.com Wed May 9 19:24:09 2001 From: matthew.cahn@bms.com (Matthew Cahn) Date: Wed, 09 May 2001 14:24:09 -0400 Subject: [DB-SIG] Help installing DCOracle2 under NT Message-ID: <3AF98B49.411EC2DB@bms.com> Can anyone give me some help in installing DCOracle2 under Windows NT? I have: Windows NT Service Pack 5 Python 2.0 from www.python.org installed. DCO2NTA6.ZIP from http://www.zope.org/Members/matt/dco2, unzipped. Should I do this? -- it complains about not being linked against pthread: C:\Unzipped\Dco2nta6\ZOracleDA> c:\python20\python.exe setup.py install Traceback (most recent call last): File "setup.py", line 36, in ? raise exceptions.RuntimeError,'Python must be linked against -lpthread' RuntimeError: Python must be linked against -lpthread I copied dco2.pyd into C:\Python20\DLLs. Then I get: In a python shell in IDLE: >>> import dco2 Traceback (innermost last): File "", line 1, in ? import dco2 ImportError: DLL load failed: The specified module could not be found. Any help would be appreciated. Matthew Cahn Matthew.CahnNOSPAM@bms.com From Andreas Jung" Message-ID: <019001c0d94a$2ba36630$9865fea9@SUXLAP> Hi, using DistUtils for installing DCO2 is currently only working for Unix (tested under Linux). Try to remove the check from the setup.py file. Otherwise try to run the Makefile by hand. Checking for -lpthread is neccessary under Unix because Python and DCO2 will not run when the Python interpreter is linked against -lpth. Did you use the source code or the binary distribution ? Andreas Digital Creations ----- Original Message ----- From: "Matthew Cahn" To: Cc: Sent: Wednesday, May 09, 2001 2:24 PM Subject: [DB-SIG] Help installing DCOracle2 under NT > Can anyone give me some help in installing DCOracle2 under > Windows NT? > > I have: > > Windows NT Service Pack 5 > Python 2.0 from www.python.org installed. > DCO2NTA6.ZIP from http://www.zope.org/Members/matt/dco2, > unzipped. > > Should I do this? -- it complains about not being linked against > pthread: > > C:\Unzipped\Dco2nta6\ZOracleDA> c:\python20\python.exe > setup.py install > Traceback (most recent call last): > File "setup.py", line 36, in ? > raise exceptions.RuntimeError,'Python must be linked > against -lpthread' > RuntimeError: Python must be linked against -lpthread > > I copied dco2.pyd into C:\Python20\DLLs. > > Then I get: > > In a python shell in IDLE: > >>> import dco2 > Traceback (innermost last): > File "", line 1, in ? > import dco2 > ImportError: DLL load failed: The specified module could not > be found. > > Any help would be appreciated. > > Matthew Cahn > Matthew.CahnNOSPAM@bms.com > > > > _______________________________________________ > DB-SIG maillist - DB-SIG@python.org > http://mail.python.org/mailman/listinfo/db-sig From Matthew.Cahn@bms.com Thu May 10 15:12:19 2001 From: Matthew.Cahn@bms.com (Matthew Cahn) Date: Thu, 10 May 2001 10:12:19 -0400 Subject: [DB-SIG] Help installing DCOracle2 under NT References: <3AF98B49.411EC2DB@bms.com> <019001c0d94a$2ba36630$9865fea9@SUXLAP> Message-ID: <3AFAA1C3.4B9F1BD0@bms.com> --------------AF992953BB3D519D9F4883C7 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit I installed the binary distribution of Python 2.0 under NT. Do I need to compile DCOracle2, or might there be a binary distribution for NT? Thanks, Matthew Andreas Jung wrote: > Hi, > > using DistUtils for installing DCO2 is currently only working for Unix > (tested > under Linux). Try to remove the check from the setup.py file. Otherwise try > to run the Makefile by hand. Checking for -lpthread is neccessary under Unix > because Python and DCO2 will not run when the Python interpreter is linked > against -lpth. > > Did you use the source code or the binary distribution ? > > Andreas > Digital Creations > > ----- Original Message ----- > From: "Matthew Cahn" > To: > Cc: > Sent: Wednesday, May 09, 2001 2:24 PM > Subject: [DB-SIG] Help installing DCOracle2 under NT > > > Can anyone give me some help in installing DCOracle2 under > > Windows NT? > > > > I have: > > > > Windows NT Service Pack 5 > > Python 2.0 from www.python.org installed. > > DCO2NTA6.ZIP from http://www.zope.org/Members/matt/dco2, > > unzipped. > > > > Should I do this? -- it complains about not being linked against > > pthread: > > > > C:\Unzipped\Dco2nta6\ZOracleDA> c:\python20\python.exe > > setup.py install > > Traceback (most recent call last): > > File "setup.py", line 36, in ? > > raise exceptions.RuntimeError,'Python must be linked > > against -lpthread' > > RuntimeError: Python must be linked against -lpthread > > > > I copied dco2.pyd into C:\Python20\DLLs. > > > > Then I get: > > > > In a python shell in IDLE: > > >>> import dco2 > > Traceback (innermost last): > > File "", line 1, in ? > > import dco2 > > ImportError: DLL load failed: The specified module could not > > be found. > > > > Any help would be appreciated. > > > > Matthew Cahn > > Matthew.CahnNOSPAM@bms.com > > > > > > > > _______________________________________________ > > DB-SIG maillist - DB-SIG@python.org > > http://mail.python.org/mailman/listinfo/db-sig -- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Matthew Cahn % Principal Scientific Support Analyst % Bristol-Myers Squibb Company % Mailbox code: H23-05 % P.O. Box 4000 % Princeton, NJ 08543-4000 % % Phone: (609) 252-3477 % Fax: (609) 252-6030 % Cell: (609) 462-3603 % Email: Matthew.Cahn@bms.com %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% --------------AF992953BB3D519D9F4883C7 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit I installed the binary distribution of Python 2.0 under NT.

Do I need to compile DCOracle2, or might there be a binary
distribution for NT?

Thanks,
Matthew

Andreas Jung wrote:

Hi,

using DistUtils for installing DCO2 is currently only working for Unix
(tested
under Linux). Try to remove the check from the setup.py file. Otherwise try
to run the Makefile by hand. Checking for -lpthread is neccessary under Unix
because Python and DCO2 will not run when the Python interpreter is linked
against -lpth.

Did you use the source code or the binary distribution ?

Andreas
Digital Creations

----- Original Message -----
From: "Matthew Cahn" <matthew.cahn@bms.com>
To: <db-sig@python.org>
Cc: <matt@digicool.com>
Sent: Wednesday, May 09, 2001 2:24 PM
Subject: [DB-SIG] Help installing DCOracle2 under NT

> Can anyone give me some help in installing DCOracle2 under
> Windows NT?
>
> I have:
>
>    Windows NT Service Pack 5
>    Python 2.0 from www.python.org installed.
>    DCO2NTA6.ZIP from http://www.zope.org/Members/matt/dco2,
> unzipped.
>
> Should I do this? -- it complains about not being linked against
> pthread:
>
>    C:\Unzipped\Dco2nta6\ZOracleDA>   c:\python20\python.exe
> setup.py install
>    Traceback (most recent call last):
>      File "setup.py", line 36, in ?
>        raise exceptions.RuntimeError,'Python must be linked
> against -lpthread'
>    RuntimeError: Python must be linked against -lpthread
>
> I copied dco2.pyd into C:\Python20\DLLs.
>
> Then I get:
>
>    In a python shell in IDLE:
>    >>> import dco2
>    Traceback (innermost last):
>      File "<pyshell#7>", line 1, in ?
>        import dco2
>    ImportError: DLL load failed: The specified module could not
> be found.
>
> Any help would be appreciated.
>
> Matthew Cahn
> Matthew.CahnNOSPAM@bms.com
>
>
>
> _______________________________________________
> DB-SIG maillist  -  DB-SIG@python.org
> http://mail.python.org/mailman/listinfo/db-sig

-- 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  Matthew Cahn
%  Principal Scientific Support Analyst
%  Bristol-Myers Squibb Company
%  Mailbox code: H23-05
%  P.O. Box 4000
%  Princeton, NJ 08543-4000
%
%  Phone: (609) 252-3477
%  Fax:   (609) 252-6030
%  Cell:  (609) 462-3603
%  Email: Matthew.Cahn@bms.com
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  --------------AF992953BB3D519D9F4883C7-- From seyan8@yahoo.com Fri May 11 13:52:08 2001 From: seyan8@yahoo.com (Se Yan Kang) Date: Fri, 11 May 2001 05:52:08 -0700 (PDT) Subject: [DB-SIG] source code in python for connection of Ms SQL residing in Windows NT with Python residing in linux Message-ID: <20010511125208.67555.qmail@web10508.mail.yahoo.com> Hi Everybody, I am currently new to python world. I have a problem in writing the code for connecting Ms SQL database residing in Windows NT with Python resided at Linux platform. Can anyone help me to solve the problem probably give me the code of it? Thank you Regards, Jason __________________________________________________ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/ From Benjamin.Schollnick@usa.xerox.com Fri May 11 14:08:57 2001 From: Benjamin.Schollnick@usa.xerox.com (Schollnick, Benjamin) Date: Fri, 11 May 2001 09:08:57 -0400 Subject: [DB-SIG] "Freezing" MX applications Message-ID: I'm running into a big problem here... With Python 2.0, and the mx package(s) - mx-base v2.0.1 & mx-commercial - 2.0.2, both Gordon McMillon's Installer (v4.1a) and py2exe (v0.26) are failing... mx.DateTime is being "archived", but mx.ODBC (& children) are not being captured for archiving.... Has anyone had any success with these packages? Previously with python v1.52 and a previous installer (mcMillon), I was able to get this to work.... But the lazy module has changed, and is seemingly defeating all the packages... Is there anyway to stop the lazy loads? I tried editting the __init__.py in the ODBC directory and started to get crashes (GPF/Dr.Watson's) when the application finished.... (Everything worked fine, until the program ended....) - Benjamin The py2exe problem maybe simple, I haven't used distutils before, and can't seem to get the package line (when in the setup function) to work... When the commented package line is in the setup function, it reports that mx isn't a package? #!/usr/bin/env python from distutils.core import setup import py2exe setup(name="Viewer", version="1.5", description="Homepage Viewer", author="Benjamin Schollnick", author_email="Benjamin.Schollnick@usa.xerox.com", url="http://xww.psg-techservices.world.xerox.com", scripts = ["viewer.py"], ) # packages=['mx', 'mx.ODBC', 'mx.DateTime'], From drbaker@softhome.net Sat May 19 21:24:08 2001 From: drbaker@softhome.net (Dennis Baker) Date: Sat, 19 May 2001 13:24:08 -0700 Subject: [DB-SIG] mxODBC Message-ID: <20010519132408.3d3718ba.drbaker@softhome.net> I'm having a problem trapping mxODBC.Warning, I've tried : except mx.odbc.Windows.error.Warning: and except mx.odbc.Windows.error: I've read the mxODBC web page and I really don't want to recompile mxODBC, is that the only option? From mal@lemburg.com Sat May 19 22:04:36 2001 From: mal@lemburg.com (M.-A. Lemburg) Date: Sat, 19 May 2001 23:04:36 +0200 Subject: [DB-SIG] mxODBC References: <20010519132408.3d3718ba.drbaker@softhome.net> Message-ID: <3B06DFE4.5BF4BDA7@lemburg.com> Dennis Baker wrote: > > I'm having a problem trapping mxODBC.Warning, I've tried : > > except mx.odbc.Windows.error.Warning: > > and > > except mx.odbc.Windows.error: > > I've read the mxODBC web page and I really don't want to recompile mxODBC, is that the only option? The correct exception object is: mx.ODBC.Windows.Warning (each mxODBC subpackages has its own set of exceptions) -- Marc-Andre Lemburg CEO eGenix.com Software GmbH ______________________________________________________________________ Company & Consulting: http://www.egenix.com/ Python Software: http://www.lemburg.com/python/ From kjcole@gri.gallaudet.edu Thu May 24 20:04:40 2001 From: kjcole@gri.gallaudet.edu (Kevin Cole) Date: Thu, 24 May 2001 15:04:40 -0400 (EDT) Subject: [DB-SIG] Please help: Python/PostgreSQL DateTime.py problems Message-ID: Hi, Can anyone tell me what I've got messed up NOW? I've just installed the "latest" PostgreSQL RPM's (7.1.1) on two different machines, and rebuilt their databases. I have slightly different versions of Python on each machine. Now I FINALLY have pgdb.py... except it still doesn't work. Both had different problems with DateTime.py. (Package versions listed below the error output below.) _____________________________________________________________________________ On MACHINE ONE I get: >>> import pgdb Traceback (innermost last): File "", line 1, in ? File "/usr/lib/python1.5/site-packages/pgdb.py", line 65, in ? except ImportError: import DateTime File "/usr/lib/python1.5/site-packages/DateTime/__init__.py", line 85, in ? from DateTime import DateTime File "/usr/lib/python1.5/site-packages/DateTime/DateTime.py", line 90, in ? import sys, os, math, regex, ts_regex, DateTimeZone ImportError: No module named ts_regex _____________________________________________________________________________ On MACHINE TWO I get: >>> import pgdb Traceback (innermost last): File "", line 1, in ? File "/usr/lib/python1.5/site-packages/pgdb.py", line 65, in ? except ImportError: import DateTime ImportError: No module named DateTime _____________________________________________________________________________ The installed packages are: MACHINE ONE: MACHINE TWO: --------------------- --------------------- python-1.5.2-27 python-1.5.2-30 pythonlib-1.27-1 pythonlib-1.28-1 python-devel-1.5.2-27 python-devel-1.5.2-30 python-docs-1.5.2-27 python-tools-1.5.2-30 python-xmlrpc-1.4-1 python-xmlrpc-1.4-1 python2-2.1-4 python2-devel-2.1-4 python2-tkinter-2.1-4 python2-tools-2.1-4 BOTH MACHINES HAVE: ------------------------ postgresql-odbc-7.1-1 postgresql-jdbc-7.1-1 postgresql-server-7.1-1 postgresql-docs-7.1-1 postgresql-contrib-7.1-1 postgresql-python-7.1-1 postgresql-tk-7.1-1 postgresql-perl-7.1-1 postgresql-test-7.1-1 postgresql-7.1-1 postgresql-libs-7.1-1 postgresql-tcl-7.1-1 postgresql-devel-7.1-1 _____________________________________________________________________________ Thanks for any assistance! From akuchlin@mems-exchange.org Thu May 24 20:12:59 2001 From: akuchlin@mems-exchange.org (Andrew Kuchling) Date: Thu, 24 May 2001 15:12:59 -0400 Subject: [DB-SIG] Please help: Python/PostgreSQL DateTime.py problems In-Reply-To: ; from kjcole@gri.gallaudet.edu on Thu, May 24, 2001 at 03:04:40PM -0400 References: Message-ID: <20010524151259.A30802@ute.cnri.reston.va.us> On Thu, May 24, 2001 at 03:04:40PM -0400, Kevin Cole wrote: > File "/usr/lib/python1.5/site-packages/DateTime/DateTime.py", line 90, in ? > import sys, os, math, regex, ts_regex, DateTimeZone >ImportError: No module named ts_regex This is the DateTime package that comes with Zope. It is not the DateTime package that the PostgreSQL interface wants; it wants mx.DateTime from www.egenix.com. (Not sure why the Zope one is on your path...) > File "/usr/lib/python1.5/site-packages/pgdb.py", line 65, in ? > except ImportError: import DateTime >ImportError: No module named DateTime This machine has neither Zope nor mx.DateTime on it. --amk From kjcole@gri.gallaudet.edu Thu May 24 22:54:14 2001 From: kjcole@gri.gallaudet.edu (Kevin Cole) Date: Thu, 24 May 2001 17:54:14 -0400 (EDT) Subject: [DB-SIG] Please help: Python/PostgreSQL DateTime.py problems In-Reply-To: <20010524151259.A30802@ute.cnri.reston.va.us> Message-ID: THANK YOU! That solved it. I finally have Python talking to PostgreSQL on both machines (and between machines). I have another less pressing (and probably much simpler) question: If I'm running PostgreSQL without the network, what do I tell the connect()? It really seemed to want a hostname, and wasn't thrilled with "localhost". Until I added the "-i" to postmaster, both x.connect("mystuff") and x.connect("localhost:mystuff") failed. On Thu, 24 May 2001, Andrew Kuchling wrote: > On Thu, May 24, 2001 at 03:04:40PM -0400, Kevin Cole wrote: > > File "/usr/lib/python1.5/site-packages/DateTime/DateTime.py", line 90, in ? > > import sys, os, math, regex, ts_regex, DateTimeZone > >ImportError: No module named ts_regex > > This is the DateTime package that comes with Zope. It is not the > DateTime package that the PostgreSQL interface wants; it wants > mx.DateTime from www.egenix.com. (Not sure why the Zope one is on > your path...) > > > File "/usr/lib/python1.5/site-packages/pgdb.py", line 65, in ? > > except ImportError: import DateTime > >ImportError: No module named DateTime > > This machine has neither Zope nor mx.DateTime on it. > > --amk > > _______________________________________________ > DB-SIG maillist - DB-SIG@python.org > http://mail.python.org/mailman/listinfo/db-sig > -- Kevin Cole, RHCE, Linux Admin | E-mail: kjcole@gri.gallaudet.edu Gallaudet Research Institute | WWW: http://gri.gallaudet.edu/~kjcole/ Hall Memorial Bldg S-419 | Voice: (202) 651-5135 Washington, D.C. 20002-3695 | FAX: (202) 651-5746 From andy@dustman.net Thu May 24 23:01:43 2001 From: andy@dustman.net (Andy Dustman) Date: Thu, 24 May 2001 18:01:43 -0400 (EDT) Subject: [DB-SIG] MySQLdb-0.9.0c2 and ZMySQLDA-2.0.7b1 co-release Message-ID: The final (I hope) candidate release for MySQLdb-0.9.0 is out. I hope to push out the real 0.9.0 some time next week. In addition, ZMySQLDA-2.0.7b1 is also out. It needs MySQLdb-0.9.0, if you hadn't already guessed. I'd also like to do a 2.0.7 release next week as well. I'd appreciate some testing and feedback, even if it's just "Worked fine for me". Please notify me of any bad behavior. Summary of major changes: MySQLdb: Is now a true package format. This results in some minor incompatibilities with earlier versions, though if you stick with using the DB API, you shouldn't have to change anything. If you are creating your own type converters or special cursors, then you might need to make a few changes. Fully documented in the source for use with pydoc (in Python 2.1). The external documentation has been expanded to include some instructive examples. With the release of MySQL-Max (the binary package with BDB and InnoDB table support), I have been able to do some real testing with transactions, and everything looks ok. Binary packages for Python 1.5.2 and 2.1 are available (tarball and RPM). ZMySQLDA: Most of the updates are behind the scene so that it will work with 0.9.0. A + or - at the beginning of the connection string will now either force transactions on or off. It tries to return INTEGER columns as Python integers; if this fails (i.e. column is really UNSIGNED INT), they are returned as longs. This eliminates the trailing L's for the most part, even though this should not be an issue with Zope 2.4 since it uses Python 2.1, which does not add the L on str(). Note that if you are using a pre-compiled Zope binary package, you will need to relocate MySQLdb so that Zope's Python interpreter can find it. If compiling yourself, you can probably do: python setup.py install --prefix /path/to/zope (for more options, try: python setup.py install --help) https://sourceforge.net/project/showfiles.php?group_id=22307 -- Andy Dustman PGP: 0xC72F3F1D @ .net http://dustman.net/andy "I'd rather listen to Newton than to Mundie. He may have been dead for almost three hundred years, but despite that he stinks up the room less." -- Linus T. From pierre@saiph.com Fri May 25 11:39:00 2001 From: pierre@saiph.com (pierre@saiph.com) Date: Fri, 25 May 2001 12:39:00 +0200 (CEST) Subject: [DB-SIG] postgres access to db structure Message-ID: <15118.13892.734825.338119@petru.saiph.fr> Hello everybody, Im new to this list My configuration: linux SuSE 7.0, postgres, python 1.5.2, psycopg I have a little app to develop, but if this works fine, the use of db might spread in our apps (as an alternative to bsddb and/or marshalling) Trying to keep all information in one place, as I have been taught, I try not to hardcode field names in the python code. One simple question: how can I query a database, to know which fields it has? the description attribute of a cursor seems ok to me, but its valid only when a query has been run, there must be a better way. I think I remember at least some DB (db2?) have system tables, holding this kind of information; is this normalized? how-to in postgres? I didnt find this in postgres doc. Sorry, its hardly a question for this list, more pure database... --=20 Pierre Imbaud 12 Rue des Bosquets 91480 Quincy Sous S=E9nart France Tel: 01 69 00 94 57 Fax 09 47 From fog@mixadlive.com Fri May 25 12:07:58 2001 From: fog@mixadlive.com (Federico Di Gregorio) Date: 25 May 2001 13:07:58 +0200 Subject: [DB-SIG] postgres access to db structure In-Reply-To: <15118.13892.734825.338119@petru.saiph.fr> References: <15118.13892.734825.338119@petru.saiph.fr> Message-ID: <990788880.8388.6.camel@lola> from a psql prompt (connected to any db) just type: \dS to print the full list of system tables. they are always available, so you just need to connect your application to the 'template1' database and the start quering the system tables. On 25 May 2001 12:39:00 +0200, pierre@saiph.com wrote: > Hello everybody, Im new to this list > My configuration: linux SuSE 7.0, postgres, python 1.5.2, psycopg > I have a little app to develop, but if this works fine, the use of db > might spread in our apps (as an alternative to bsddb and/or > marshalling) > Trying to keep all information in one place, as I have been taught, I > try not to hardcode field names in the python code. One simple > question: how can I query a database, to know which fields it has? the > description attribute of a cursor seems ok to me, but its valid only > when a query has been run, there must be a better way. > I think I remember at least some DB (db2?) have system tables, holding > this kind of information; is this normalized? how-to in postgres? > I didnt find this in postgres doc. > Sorry, its hardly a question for this list, more pure database... > > -- > Pierre Imbaud > 12 Rue des Bosquets 91480 Quincy Sous Sénart France > Tel: 01 69 00 94 57 Fax 09 47 > > > _______________________________________________ > DB-SIG maillist - DB-SIG@python.org > http://mail.python.org/mailman/listinfo/db-sig -- Federico Di Gregorio MIXAD LIVE Chief of Research & Technology fog@mixadlive.com Debian GNU/Linux Developer & Italian Press Contact fog@debian.org Don't dream it. Be it. -- Dr. Frank'n'further From trenfro@ephibian.com Fri May 25 21:01:14 2001 From: trenfro@ephibian.com (Tom Renfro) Date: Fri, 25 May 2001 13:01:14 -0700 Subject: [DB-SIG] postgres access to db structure References: <15118.13892.734825.338119@petru.saiph.fr> Message-ID: <3B0EBA0A.147E9A09@ephibian.com> If you are looking for the column names for a table, look in the pg_attribute table. Something like the following should work: select b.attnum, a.relname,b.attname,c.typname from pg_class a, pg_attribute b, pg_type c where a.oid=3Db.attrelid and c.oid=3Db.atttypid and b.attnum > 0 order by a.relname, b.attnum; It is vaguely reminiscent of the ALL_TAB_COLUMNS view in Oracle... pierre@saiph.com wrote: >=20 > Hello everybody, Im new to this list > My configuration: linux SuSE 7.0, postgres, python 1.5.2, psycopg > I have a little app to develop, but if this works fine, the use of db > might spread in our apps (as an alternative to bsddb and/or > marshalling) > Trying to keep all information in one place, as I have been taught, I > try not to hardcode field names in the python code. One simple > question: how can I query a database, to know which fields it has? the > description attribute of a cursor seems ok to me, but its valid only > when a query has been run, there must be a better way. > I think I remember at least some DB (db2?) have system tables, holding > this kind of information; is this normalized? how-to in postgres? > I didnt find this in postgres doc. > Sorry, its hardly a question for this list, more pure database... >=20 > -- > Pierre Imbaud > 12 Rue des Bosquets 91480 Quincy Sous S=E9nart France > Tel: 01 69 00 94 57 Fax 09 47 >=20 > _______________________________________________ > DB-SIG maillist - DB-SIG@python.org > http://mail.python.org/mailman/listinfo/db-sig --=20 -Tom --- Tom Renfro Software Engineer Ephibian From kromag@nsacom.net Sat May 26 00:52:53 2001 From: kromag@nsacom.net (kromag@nsacom.net) Date: Fri, 25 May 2001 16:52:53 -0700 (PDT) Subject: [DB-SIG] experimentation with access using win32com.client Message-ID: <200105252352.f4PNqqL03088@pop.nsacom.net> Hi all, *NEWBIE ALERT* I have been having some fun with win32com.client and access 7 using the dandy examples at http://starship.python.net/crew/bwilk/access.html. Everything seems crystal clear to me for writing to the database. The weird thing is, I can't seam to get a human-readable query. I have tried the following: >>> import win32com.client >>> engine=win32com.client.Dispatch("DAO.DBEngine.35") >>> db=engine.OpenDatabase("\windows\desktop\db2.mdb") >>> rs=db.OpenRecordset("select beans from food where corn='39114'") ## I know the value exists! >>> rs Hrm. Now shouldn't this display the output from my query? I have done similar stuff with postgresql with success (unless I am hallucinating- not an unwarranted assumption....) As I recall, when performing a similar act using pygresql and postgres in IDLE on Linux, I could not get the actual output of the query, only a type message. I am sure I am missing something obvious! :-/ Thanks! d From pierre@saiph.com Fri May 25 12:08:30 2001 From: pierre@saiph.com (pierre@saiph.com) Date: Fri, 25 May 2001 13:08:30 +0200 (CEST) Subject: [DB-SIG] over the API Message-ID: <15118.15662.243418.982768@petru.saiph.fr> I have the feeling, and many people seem to have the same, I lack some obvious functionnality when using the DB-api; I have seen many demands to add functionnality on this list, and a good answer to this: lets not increase the burden of the implementers: if its too high, people will become reluctant to comply to the API; So I think we should take the problem some other way; Ill explain this with the C/UNIX interface: The C developper on an UNIX machine can use functions from 2 distinct library sets: - system calls: these are C wrappers to the UNIX API: a very minimal set of functions, designed not to be handy, but to provide ALL the functionnality needed to drive the system; it does not pretend to be handy, it does not have to: it has to be solid, well documented, complete. - library functions: this is an other layer, written in C, well documented too, providing the handiness one cant find at the system call level. - system calls implementation is system dependent, libraries are not: when a new system is built (on a new processor, for instance), only system calls give a hard time (assembler function, direct access to registers, for instance), libraries are just compiled. Some (most?) of these library functions have been put in the C ANSI specification, hence can be called from a program whatever the system: (Unix, dos, mac). They form a natural new API for developpers with portability concerns. So I think this is just what is needed here: a library module, layer between the app accessing the DB, and the actual module implementing the DB API; Examples of functionnalities to put there: - row objects with easy to access colums (row['col'], or row.col) - Automatic building of queries, from a {col: 'value'} dict. OK, I guess its a mess to agree on, some work to develop. I guess its a long-time project. And maybe its not one module but many, and maybe incompatible solutions too. Too bad, in the meantime, Ill develop my own function set. --=20 Pierre Imbaud 12 Rue des Bosquets 91480 Quincy Sous S=E9nart France Tel: 01 69 00 94 57 Fax 09 47 From fog@mixadlive.com Sat May 26 00:14:51 2001 From: fog@mixadlive.com (Federico Di Gregorio) Date: 26 May 2001 01:14:51 +0200 Subject: [DB-SIG] over the API In-Reply-To: <15118.15662.243418.982768@petru.saiph.fr> References: <15118.15662.243418.982768@petru.saiph.fr> Message-ID: <990832493.15479.3.camel@lola> hi, you are quite right. i begun to write a new pep, on dbapi extensions (see past thread on this mailing list.) my idea is to both document "standard" extensions to the dbapi and provide a reference implementation (where possible) in python. apart from the stuff you simply can't do without some help from the driver, like type-casting. (type casting should be done by the driver, because the next layer won't have any clues on the original types, for example.) i hope to have something to post in a week or two but my work the new release of psycopg (finally implementing the *full* api) is keeping me busy. On 25 May 2001 13:08:30 +0200, pierre@saiph.com wrote: > I have the feeling, and many people seem to have the same, I lack > some obvious functionnality when using the DB-api; I have seen > many demands to add functionnality on this list, and a good answer > to this: lets not increase the burden of the implementers: if its > too high, people will become reluctant to comply to the API; [snip] > - Automatic building of queries, from a {col: 'value'} dict. this is in the dbapi. if the driver support the pydict style you can simply do: cursor.execute("INSERT INTO baz VALUES (%(foo)s, '%(bar)')", {'foo':23, 'bar':'i love psogresql'}) ciao, federico -- Federico Di Gregorio MIXAD LIVE Chief of Research & Technology fog@mixadlive.com Debian GNU/Linux Developer & Italian Press Contact fog@debian.org Best friends are often failed lovers. -- Me From fve@phgroup.com Sat May 26 13:39:31 2001 From: fve@phgroup.com (Frederic Vander Elst) Date: Sat, 26 May 2001 13:39:31 +0100 Subject: [DB-SIG] postgres access to db structure References: <15118.13892.734825.338119@petru.saiph.fr> <3B0EBA0A.147E9A09@ephibian.com> Message-ID: <3B0FA403.D7837803@phgroup.com> I believe there is a platform-independent way of doing this : select * from mytable where 1=3D0 from my experience, this works via mxODBC against db2, oracle, postgres, = and vfox tables types of dbs. hth, -freddie vander elst add an e before the @. Tom Renfro wrote: > If you are looking for the column names for a table, look > in the pg_attribute table. Something like the following should > work: > > select b.attnum, a.relname,b.attname,c.typname from pg_class a, > pg_attribute b, pg_type c where a.oid=3Db.attrelid and c.oid=3Db.atttyp= id > and b.attnum > 0 order by a.relname, b.attnum; > > It is vaguely reminiscent of the ALL_TAB_COLUMNS view in Oracle... > > pierre@saiph.com wrote: > > > > Hello everybody, Im new to this list > > My configuration: linux SuSE 7.0, postgres, python 1.5.2, psycopg > > I have a little app to develop, but if this works fine, the use of db= > > might spread in our apps (as an alternative to bsddb and/or > > marshalling) > > Trying to keep all information in one place, as I have been taught, I= > > try not to hardcode field names in the python code. One simple > > question: how can I query a database, to know which fields it has? th= e > > description attribute of a cursor seems ok to me, but its valid only > > when a query has been run, there must be a better way. > > I think I remember at least some DB (db2?) have system tables, holdin= g > > this kind of information; is this normalized? how-to in postgres? > > I didnt find this in postgres doc. > > Sorry, its hardly a question for this list, more pure database... > > > > -- > > Pierre Imbaud > > 12 Rue des Bosquets 91480 Quincy Sous S=E9nart France > > Tel: 01 69 00 94 57 Fax 09 47 > > > > _______________________________________________ > > DB-SIG maillist - DB-SIG@python.org > > http://mail.python.org/mailman/listinfo/db-sig > > -- > -Tom > --- > Tom Renfro > Software Engineer > Ephibian > > _______________________________________________ > DB-SIG maillist - DB-SIG@python.org > http://mail.python.org/mailman/listinfo/db-sig From djc@object-craft.com.au Sat May 26 14:04:15 2001 From: djc@object-craft.com.au (Dave Cole) Date: 26 May 2001 23:04:15 +1000 Subject: [DB-SIG] postgres access to db structure In-Reply-To: Frederic Vander Elst's message of "Sat, 26 May 2001 13:39:31 +0100" References: <15118.13892.734825.338119@petru.saiph.fr> <3B0EBA0A.147E9A09@ephibian.com> <3B0FA403.D7837803@phgroup.com> Message-ID: >>>>> "fve" == Frederic Vander Elst writes: fve> I believe there is a platform-independent way of doing this : fve> select * from mytable where 1=0 fve> from my experience, this works via mxODBC against db2, oracle, fve> postgres, and vfox tables types of dbs. It also works for my Sybase module. - Dave -- http://www.object-craft.com.au From fog@mixadlive.com Sat May 26 14:24:03 2001 From: fog@mixadlive.com (Federico Di Gregorio) Date: 26 May 2001 15:24:03 +0200 Subject: [DB-SIG] postgres access to db structure In-Reply-To: References: <15118.13892.734825.338119@petru.saiph.fr> <3B0EBA0A.147E9A09@ephibian.com> <3B0FA403.D7837803@phgroup.com> Message-ID: <990883445.5269.0.camel@lola> On 26 May 2001 23:04:15 +1000, Dave Cole wrote: > >>>>> "fve" == Frederic Vander Elst writes: > > fve> I believe there is a platform-independent way of doing this : > fve> select * from mytable where 1=0 > > fve> from my experience, this works via mxODBC against db2, oracle, > fve> postgres, and vfox tables types of dbs. > > It also works for my Sybase module. works in psycopg too, but sometimes you don't know 'mytable', e.g., when you're writing a db management tool that need the full list of tables, etc. -- Federico Di Gregorio MIXAD LIVE Chief of Research & Technology fog@mixadlive.com Debian GNU/Linux Developer & Italian Press Contact fog@debian.org Debian. The best software from the best people [see above] -- brought to you by One Line Spam From darcy@druid.net Sat May 26 14:36:34 2001 From: darcy@druid.net (D'Arcy J.M. Cain) Date: Sat, 26 May 2001 09:36:34 -0400 (EDT) Subject: [DB-SIG] Please help: Python/PostgreSQL DateTime.py problems In-Reply-To: "from Kevin Cole at May 24, 2001 05:54:14 pm" Message-ID: <20010526133634.652941A95@druid.net> Thus spake Kevin Cole > I have another less pressing (and probably much simpler) question: > If I'm running PostgreSQL without the network, what do I tell the > connect()? It really seemed to want a hostname, and wasn't thrilled > with "localhost". Until I added the "-i" to postmaster, both > x.connect("mystuff") and x.connect("localhost:mystuff") failed. You are right. There is a problem there. I am going to have to see what I can do about that. It should really be using the "Classic" connect method. As it is it mandates the -i option and that should definitely be optional. I am bringing it up on the PyGreSQL mailing list. -- D'Arcy J.M. Cain | Democracy is three wolves http://www.druid.net/darcy/ | and a sheep voting on +1 416 425 1212 (DoD#0082) (eNTP) | what's for dinner. From darcy@druid.net Sat May 26 14:57:36 2001 From: darcy@druid.net (D'Arcy J.M. Cain) Date: Sat, 26 May 2001 09:57:36 -0400 (EDT) Subject: [DB-SIG] Please help: Python/PostgreSQL DateTime.py problems In-Reply-To: <20010526133634.652941A95@druid.net> "from D'Arcy J.M. Cain at May 26, 2001 09:36:34 am" Message-ID: <20010526135737.0AE911A91@druid.net> Thus spake D'Arcy J.M. Cain > Thus spake Kevin Cole > > I have another less pressing (and probably much simpler) question: > > If I'm running PostgreSQL without the network, what do I tell the > > connect()? It really seemed to want a hostname, and wasn't thrilled > > with "localhost". Until I added the "-i" to postmaster, both > > x.connect("mystuff") and x.connect("localhost:mystuff") failed. > > You are right. There is a problem there. I am going to have to see what > I can do about that. It should really be using the "Classic" connect > method. As it is it mandates the -i option and that should definitely > be optional. I am bringing it up on the PyGreSQL mailing list. I found a way around this. Open with the following command. x.connect(":mystuff") -- D'Arcy J.M. Cain | Democracy is three wolves http://www.druid.net/darcy/ | and a sheep voting on +1 416 425 1212 (DoD#0082) (eNTP) | what's for dinner. From LuisLeonelLopez@HOTMAIL.COM Wed May 30 03:35:16 2001 From: LuisLeonelLopez@HOTMAIL.COM (Luis Leonel Lopez) Date: Tue, 29 May 2001 23:35:16 -0300 Subject: [DB-SIG] Python and FoxPro. Message-ID: This is a multi-part message in MIME format. ------=_NextPart_000_0035_01C0E898.041916C0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Dear friends, I'd want to use Python with FoxPro (exactly Visual FoxPro 5.0). What = should I do? Thanks in advance. Luis Leonel Lopez ------=_NextPart_000_0035_01C0E898.041916C0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Dear friends,
 
I'd want to use Python with FoxPro = (exactly Visual=20 FoxPro 5.0). What should I do?
 
Thanks in advance.
 
Luis Leonel = Lopez
------=_NextPart_000_0035_01C0E898.041916C0-- From mal@lemburg.com Wed May 30 08:21:49 2001 From: mal@lemburg.com (M.-A. Lemburg) Date: Wed, 30 May 2001 09:21:49 +0200 Subject: [DB-SIG] Python and FoxPro. References: Message-ID: <3B149F8D.A03C73AE@lemburg.com> > Luis Leonel Lopez wrote: > > Dear friends, > > I'd want to use Python with FoxPro (exactly Visual FoxPro 5.0). What should I do? I think that the Microsoft MDAC suite (see their web-site) includes an ODBC driver for FoxPro. You can then either use the win32all odbc module or mxODBC (see the link Python Software below) to access FoxPro using this driver. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH ______________________________________________________________________ Company & Consulting: http://www.egenix.com/ Python Software: http://www.lemburg.com/python/