From Michael_Scharf@gmx.de Wed Jan 1 23:48:11 2003 From: Michael_Scharf@gmx.de (Michael Scharf) Date: Thu, 02 Jan 2003 00:48:11 +0100 Subject: [DB-SIG] Q: database integrity, flush and corrupted files.... Message-ID: <3E137E3B.2050706@gmx.de> Hi, I am writing a little disk based hashset (like bsddb or gdbm). I am trying to find info about information about what happens in the worst case if the application is killed in the wrong moment (e.g. in the middle of a flush). In particular: if I do: f.write(x) f.write(y) can I assume that when y gets flushed that x has been flushed? If I do: pos=f.tell() f.write(x) f.seek(pos-len(x)-len(y)) # going before x f.write(y) Do I have to expect that y might be flushed before x? Or is auto-flushing completely random (I am talking about windows)? Does anybody know a pointer where I can read about this? Michael From msanchez@grupoburke.com Thu Jan 2 15:17:13 2003 From: msanchez@grupoburke.com (Marcos =?ISO-8859-1?Q?S=E1nchez?= Provencio) Date: 02 Jan 2003 16:17:13 +0100 Subject: [DB-SIG] DCOracle2 and callproc Message-ID: <1041520633.3498.8.camel@cynar> Happy new year from Madrid I am using DCOracle2 to access Ora9i in Linux. I have a bunch of preocedures in a package that were designed to be used from ADODB in Visual Basic. They return a resultset, so they act similar to Sybase/MSSQL stored procedures. I have managed to execute them and the results look fine, but the description shows nothing. Is there any solution (besides knowing in advance the columns returned) This is the code: cur=con.cursor() ret,res=cur.callproc('SOCOWNER.APP_ModoLista.APP_ModoLista','jaen',None) print ret,res.description print res.fetchall() ###Results are jaen None [['DEN', 'Denominaci\xf3n', 'a', 2.0, '-', None], ['SEC', 'Fecha Inscripci\xf3n', 'bFechas', 3.0, '-', None], ['AMB', '\xc1mbito', 'cambito', 4.0, '-', None], ['FAS', 'Fases', 'dfase', 5.0, '-', None], ['CLA', 'Clasificaci\xf3n Inscritas', 'fcla', 6.0, '-', None], ['PER', 'Intervinientes', 'm', 7.0, '-', None], ['EST', 'Listados', 'Informes', 8.0, '-', None], ['LOT', 'Tramitaci\xf3n', 'elot', 9.0, '-', None], ['DOC', 'Mantenimiento Firmantes', 'Documentos', 10.0, '-', None], ['LOC', 'Localidades', 'Localidad', 11.0, '-', None], ['VIN', 'Mantenimiento Car\xe1cter', 'ClasiSub', 12.0, '-', None]] Thanks -- Marcos Sánchez Provencio www.burke.es From matt@zope.com Thu Jan 2 15:23:02 2003 From: matt@zope.com (Matthew T. Kromer) Date: Thu, 02 Jan 2003 10:23:02 -0500 Subject: [DB-SIG] DCOracle2 and callproc References: <1041520633.3498.8.camel@cynar> Message-ID: <3E145956.6010702@zope.com> Marcos S=E1nchez Provencio wrote: >Happy new year from Madrid > >I am using DCOracle2 to access Ora9i in Linux. I have a bunch of >preocedures in a package that were designed to be used from ADODB in >Visual Basic. They return a resultset, so they act similar to >Sybase/MSSQL stored procedures. I have managed to execute them and the >results look fine, but the description shows nothing. > >Is there any solution (besides knowing in advance the columns returned) > >This is the code: > >cur=3Dcon.cursor() > =20 >ret,res=3Dcur.callproc('SOCOWNER.APP_ModoLista.APP_ModoLista','jaen',Non= e) >print ret,res.description >print res.fetchall() > >###Results are >jaen None >[['DEN', 'Denominaci\xf3n', 'a', 2.0, '-', None], ['SEC', 'Fecha >Inscripci\xf3n', 'bFechas', 3.0, '-', None], ['AMB', '\xc1mbito', >'cambito', 4.0, '-', None], ['FAS', 'Fases', 'dfase', 5.0, '-', None], >['CLA', 'Clasificaci\xf3n Inscritas', 'fcla', 6.0, '-', None], ['PER', >'Intervinientes', 'm', 7.0, '-', None], ['EST', 'Listados', 'Informes', >8.0, '-', None], ['LOT', 'Tramitaci\xf3n', 'elot', 9.0, '-', None], >['DOC', 'Mantenimiento Firmantes', 'Documentos', 10.0, '-', None], >['LOC', 'Localidades', 'Localidad', 11.0, '-', None], ['VIN', >'Mantenimiento Car\xe1cter', 'ClasiSub', 12.0, '-', None]] > >Thanks > > > =20 > Newer versions of the python part of DCOracle2 should automatically=20 describe a result cursor from a stored procedure so that the description=20 attribute is pre-set. You can also call cursor.describe() to force the=20 description to be re-fetched, but I'd just suggest you check out the=20 latest CVS copy. From msanchez@grupoburke.com Thu Jan 2 15:47:26 2003 From: msanchez@grupoburke.com (Marcos =?ISO-8859-1?Q?S=E1nchez?= Provencio) Date: 02 Jan 2003 16:47:26 +0100 Subject: [DB-SIG] DCOracle2 and callproc In-Reply-To: <3E145956.6010702@zope.com> References: <1041520633.3498.8.camel@cynar> <3E145956.6010702@zope.com> Message-ID: <1041522445.3498.11.camel@cynar> El jue, 02-01-2003 a las 16:23, Matthew T. Kromer escribió: > Marcos Sánchez Provencio wrote: > > >Happy new year from Madrid > > > >I am using DCOracle2 to access Ora9i in Linux. I have a bunch of > >preocedures in a package that were designed to be used from ADODB in > >Visual Basic. They return a resultset, so they act similar to > >Sybase/MSSQL stored procedures. I have managed to execute them and the > >results look fine, but the description shows nothing. > > > >Is there any solution (besides knowing in advance the columns returned) > > > >This is the code: > > > >cur=con.cursor() > > > >ret,res=cur.callproc('SOCOWNER.APP_ModoLista.APP_ModoLista','jaen',None) > >print ret,res.description > >print res.fetchall() > > > >###Results are > >jaen None > >[['DEN', 'Denominaci\xf3n', 'a', 2.0, '-', None], ['SEC', 'Fecha > >Inscripci\xf3n', 'bFechas', 3.0, '-', None], ['AMB', '\xc1mbito', > >'cambito', 4.0, '-', None], ['FAS', 'Fases', 'dfase', 5.0, '-', None], > >['CLA', 'Clasificaci\xf3n Inscritas', 'fcla', 6.0, '-', None], ['PER', > >'Intervinientes', 'm', 7.0, '-', None], ['EST', 'Listados', 'Informes', > >8.0, '-', None], ['LOT', 'Tramitaci\xf3n', 'elot', 9.0, '-', None], > >['DOC', 'Mantenimiento Firmantes', 'Documentos', 10.0, '-', None], > >['LOC', 'Localidades', 'Localidad', 11.0, '-', None], ['VIN', > >'Mantenimiento Car\xe1cter', 'ClasiSub', 12.0, '-', None]] > > > >Thanks > > > > > > > > > > Newer versions of the python part of DCOracle2 should automatically > describe a result cursor from a stored procedure so that the description > attribute is pre-set. You can also call cursor.describe() to force the > description to be re-fetched, but I'd just suggest you check out the > latest CVS copy. > > > The describe() did not work, but the CVS version did fine. Thank you. -- Marcos Sánchez Provencio www.burke.es From ramrom@earthling.net Thu Jan 2 16:54:31 2003 From: ramrom@earthling.net (Bob Gailer) Date: Thu, 02 Jan 2003 09:54:31 -0700 Subject: [DB-SIG] Creating Visual FoxPro tables using ODBC Message-ID: <5.2.0.9.0.20030102095339.02b76c20@66.28.54.253> --=======2ADB6150======= Content-Type: text/plain; x-avg-checked=avg-ok-10AD26B1; charset=us-ascii; format=flowed Content-Transfer-Encoding: 8bit I'm accessing Visual FoxPro tables from a Python program using ODBC. I tried cursor.execute('select blah from blah into table foo') but no table foo gets created. Is there a way to do this other than a series of inserts? If I have to use inserts, is there a way to create the empty table thru ODBC? Bob Gailer mailto:ramrom@earthling.net 303 442 2625 --=======2ADB6150======= Content-Type: text/plain; charset=us-ascii; x-avg=cert; x-avg-checked=avg-ok-10AD26B1 Content-Disposition: inline --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.431 / Virus Database: 242 - Release Date: 12/17/2002 --=======2ADB6150=======-- From mal@lemburg.com Thu Jan 2 17:18:05 2003 From: mal@lemburg.com (M.-A. Lemburg) Date: Thu, 02 Jan 2003 18:18:05 +0100 Subject: [DB-SIG] Creating Visual FoxPro tables using ODBC In-Reply-To: <5.2.0.9.0.20030102095339.02b76c20@66.28.54.253> References: <5.2.0.9.0.20030102095339.02b76c20@66.28.54.253> Message-ID: <3E14744D.5010409@lemburg.com> Bob Gailer wrote: > I'm accessing Visual FoxPro tables from a Python program using ODBC. I > tried cursor.execute('select blah from blah into table foo') but no > table foo gets created. Is there a way to do this other than a series of > inserts? If I have to use inserts, is there a way to create the empty > table thru ODBC? You create tables with "CREATE TABLE xyz (...schema...)". Inserts can then be done using "INSERT ... FROM othertable" with some databases. You should probably also check whether using a VIEW wouldn't be better in your case. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From ramrom@earthling.net Thu Jan 2 18:58:23 2003 From: ramrom@earthling.net (Bob Gailer) Date: Thu, 02 Jan 2003 11:58:23 -0700 Subject: [DB-SIG] Creating Visual FoxPro tables using ODBC In-Reply-To: <3E14744D.5010409@lemburg.com> References: <5.2.0.9.0.20030102095339.02b76c20@66.28.54.253> <5.2.0.9.0.20030102095339.02b76c20@66.28.54.253> Message-ID: <5.2.0.9.0.20030102113440.02bcac98@66.28.54.253> --=======2027515C======= Content-Type: text/plain; x-avg-checked=avg-ok-10AD26B1; charset=us-ascii; format=flowed Content-Transfer-Encoding: 8bit More background: I'm converting VFP programs to Python. Table creation and manipulation is native to VFP, so my program often includes SQL to create and then manipulate temporary tables. To convert to Python and continue using this strategy requires creating and populating temporary tables using ODBC, and seems like result will be very inefficient if I have to Create and then Insert insert insert .... That's why I wanted to use the VFP "select .... into table" which would do it all in one step. I am experimenting replacing SQL with Python operations: cursor.execute("""last_name, first_name, studentid, val(s1.score) as pre, val(s2.score) as post, etc """) tbl1 = cursor.fetchall() # SQL: select count(*) as moved, pre, post from tbl1 where post > pre group by pre t = [s[3] for s in tbl1 if s[3] > s[4]] # pre, where post > pre t.sort() # group by pre and am experimenting with a function in the comprehension applied to s[3] to accumulate the count(*) in a dictionary. I also realize that I might have the best of both worlds by using some other data base (MySQL?) that supports the operations I want to use and has a good Python API. Any suggestions. Also is there any Python-based GUI for examining and editing table contents somewhat like VFP browse? Bob Gailer mailto:ramrom@earthling.net 303 442 2625 --=======2027515C======= Content-Type: text/plain; charset=us-ascii; x-avg=cert; x-avg-checked=avg-ok-10AD26B1 Content-Disposition: inline --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.431 / Virus Database: 242 - Release Date: 12/17/2002 --=======2027515C=======-- From mal@lemburg.com Thu Jan 2 23:25:20 2003 From: mal@lemburg.com (M.-A. Lemburg) Date: Fri, 03 Jan 2003 00:25:20 +0100 Subject: [DB-SIG] Q: database integrity, flush and corrupted files.... In-Reply-To: <3E137E3B.2050706@gmx.de> References: <3E137E3B.2050706@gmx.de> Message-ID: <3E14CA60.5020602@lemburg.com> Michael Scharf wrote: > Hi, > > I am writing a little disk based hashset (like bsddb or gdbm). You do know about mxBeeBase, do you ? > I am trying to find info about information about what > happens in the worst case if the application is killed in > the wrong moment (e.g. in the middle of a flush). In > particular: if I do: > > f.write(x) > f.write(y) > > can I assume that when y gets flushed that x has been flushed? No; flushing has to be done explicitly using f.flush() for this. > If I do: > > pos=f.tell() > f.write(x) > f.seek(pos-len(x)-len(y)) # going before x > f.write(y) > > Do I have to expect that y might be flushed before x? > > Or is auto-flushing completely random (I am talking > about windows)? Flushing usually refers to writing line buffers out to the disk. Whether the file system does write-through or not depends on the settings of the file system. It also depends on how you open the file, ie. buffered or not. > Does anybody know a pointer where I can read about this? man fflush and the Python docs on files and the os module. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From nigel-c@clear.net.nz Fri Jan 3 10:00:00 2003 From: nigel-c@clear.net.nz (nigel-c@clear.net.nz) Date: Fri, 3 Jan 2003 23:00:00 +1300 (NZDT) Subject: [DB-SIG] Emulating transaction management using sagas Message-ID: <20030103100001.1FB1310160@tigger.localdomain> s posted to db-sig as persistence-sig appears to be fairly dead, and also to SAPDB-general] I've been doing a bit of frigging around and have developed a prototype application server based off the server frameworks in the python libraries. It uses ThreadingMixin, which gives it a thread-per-request model. The basic featue set is: o Configuration file using ConfigParser and overrides off the CL it's invoked from o A simple thread safe DB connection pool (more on this later) that uses SAPDB. It would be fairly simple to generalise it but I haven't yet. o A more elaborate framework to register components in a hierarchical API (it uses the XML-RPC libraries) o Expanded logging functionality to support error, call and debug logging Now comes the fun part: adding transaction management. Note that I haven't done this yet - I'm just pontificating on a couple of approaches. Transaction management (where the middle-tier can control the commit or rollback of transactions) is useful in two cases: o When the transaction should participate in a global distributed transaction that has other database managers (or even other TP monitors or app servers) participating in it (i.e. all the databases either commit or roll back together and this consistency is guaranteed by the system software), or o When a transaction should span more than one call to the middle-tier Examples of this are complex financial data entry (covering more than one screen) when you don't want to allow inconsistent records to be committed, and workflow systems where more than one user might participate in the same transaction. Remember the connection pool? In a client-server application, each client has its own connection, which has an implicit transaction context. However, the transaction context is tied to the connection. This isn't much use on pooled connections, as something else could have used the connection in between the calls to the middle tier - and the call might (in fact will probably not) get the same database connection that the first one used. Connection pooling (which is the typical approach in a 3-tier application) bollixes this up. Subsequent calls that are a part of the transaction may not use the same connection, and there may have been another transaction using it in the meantime. To do any sort of transaction management in this setting, you need to be able to pick up and put down transaction contexts. In an XA-compatible DBMS, the transaction context has its own ID, which is seperate from the connection. Thus any connection can be used with any transaction context. None of the OSS database management systems appear to be able to do this. If anyone knows something to the contrary, I'd be interested to hear. For OSS databases, we now get to find a way to fake it. I can think of two strategies, each of which have pros and cons. i. Treat a database connection as a transaction context. On a server box like a Compaq ML370, one can put 4GB of RAM onto the machine fairly cheaply these days. This would reasonably allow us to open (at a guess) something like 5,000 connections. If anyone knows how much memory Interbase, SAPDB or Postgres use per connection, I'd be interested to hear. We could therefore have 5k or so transactions open at any given time, which is a definite limit on scalability. It's a bit of a hack, but does let us use arbitrary SQL in the context of the transaction and doesn't require any i-dotting and t-crossing from the application. It's also fairly simple to implement. Another minus is that the context is tied to a single middle-tier node, so clustering is out. Transactions would have at-most-once semantics. If the middle-tier or database died, uncommitted transactions be would be rolled back. This approach would work OK for applications that use predominantly single-call transactions but have a small number of conversational transactions. ii. Use a technique called 'sagas'. This is essentially a command pattern. Original versions of all of the records affected are stored for the duration of the transactions; if the transaction is rolled back, the old records are written back to the database in a compensating transaction. Note that this has an implied read-uncommitted isolation level for data committed in the database but not actually yet 'committed' in the transaction manager. This requires some co-operation from the application, but could be substantially be automated if all transactions went through a persistence layer. Berkely DB on the application server might be a good persistence mechanism for the rollback data for in- progress transactions. This solution is more complex, and perhaps best implemented as part of a persistence mechanism to abstract away the boilerplate code that it would require. It can emulate nested and chained transactions. For a more detailed treatment of Sagas, see the Gray and Reuter transaction processing book. I'm interested to hear comments. Nigel. From Michael_Scharf@gmx.de Fri Jan 3 16:00:14 2003 From: Michael_Scharf@gmx.de (Michael Scharf) Date: Fri, 03 Jan 2003 17:00:14 +0100 Subject: [DB-SIG] Q: database integrity, flush and corrupted files.... In-Reply-To: <3E14CA60.5020602@lemburg.com> References: <3E137E3B.2050706@gmx.de> <3E14CA60.5020602@lemburg.com> Message-ID: <3E15B38E.90809@gmx.de> Hi Marc-Andre M.-A. Lemburg wrote: > You do know about mxBeeBase, do you ? Yes, but I forgot that it exists. I just tryed it and it seems to solve my problem. (I was about to implement Extendible Hashing but the BeeBase B+Tree is fast enough for my app). I looked at BeeDict. The comments seem to indicate that an index is not a reliable datastructure. My data is actually an 16-byte string (md5 checksum) and an integer. Would you recommend to store the data in a flat file as well in case of a corrupted index? With a simple stogare system like BeeStorage, after a failure it seems possible to recover (without too much data loss). Is there a recover procedure for an index? I have another (little) problem. The BeeBase indes complains about strings containing null. What is the best way to 'quote' the null bytes? What is the meaning of the keysize (what happens if keys are longer?) What is the meaning of sectorsize? (I used 1024 (the maximum!?) insted of 256 and the data base of 2 million records gets smaller and is constructed fater). > No; flushing has to be done explicitly using f.flush() for this. Hmm, but if I write a gigabyte file on a 32Mb computer, the system has to write out something at some point. Ok, it might be that this is 'permanent' and the os writes it to the disk in a hidden mode, but it becomes 'permanent' with flush. But what happens if there is a power failure during the flush? > Flushing usually refers to writing line buffers out to the > disk. Whether the file system does write-through or not > depends on the settings of the file system. It also depends > on how you open the file, ie. buffered or not. Ok, I test BeeBase a bit more and I might not be interested in those questions anymore ;-) Michael From mal@lemburg.com Fri Jan 3 21:24:42 2003 From: mal@lemburg.com (M.-A. Lemburg) Date: Fri, 03 Jan 2003 22:24:42 +0100 Subject: [DB-SIG] Q: database integrity, flush and corrupted files.... In-Reply-To: <3E15B38E.90809@gmx.de> References: <3E137E3B.2050706@gmx.de> <3E14CA60.5020602@lemburg.com> <3E15B38E.90809@gmx.de> Message-ID: <3E15FF9A.4060807@lemburg.com> Michael Scharf wrote: > Hi Marc-Andre > > M.-A. Lemburg wrote: > > You do know about mxBeeBase, do you ? > > Yes, but I forgot that it exists. I just tryed it and it seems > to solve my problem. (I was about to implement Extendible Hashing > but the BeeBase B+Tree is fast enough for my app). Be sure to use the version in egenix-mx-base 2.1 beta5 or later; the one in 2.0.4 has some bugs which are fixed in that release. > I looked at BeeDict. The comments seem to indicate > that an index is not a reliable datastructure. My data > is actually an 16-byte string (md5 checksum) and an > integer. Would you recommend to store the data in a flat > file as well in case of a corrupted index? mxBeeBase is a toolkit, so you can build your own style of storage on top of it. E.g. the BeeDict implementation uses a data file and an index for fast access. If the index gets corrupted, there is built-in support for automatic recreation of the index. The system also support locking, so it is safe to use a single mxBeeBase DB from multiple processes. > With a simple stogare system like BeeStorage, after a failure it > seems possible to recover (without too much data loss). > Is there a recover procedure for an index? Yes. Please see the source code for details. It is documented in great detail .... the written docs still need some write-up. > I have another (little) problem. The BeeBase indes complains > about strings containing null. What is the best way to 'quote' > the null bytes? Good question. I've never had that problem... why would you want to have NULLs in strings that you use for an index ? > What is the meaning of the keysize (what happens if keys are longer?) That's just for managing the B*Tree data structure. Keys can be up to 158 bytes. Longer keys slow down lookups though. If you don't need sorted lookups, hashing is faster. > What is the meaning of sectorsize? (I used 1024 (the maximum!?) insted > of 256 and the data base of 2 million records gets smaller and is > constructed fater). The sector size should be chosen to match the physical buffer size of the IO device where you keep the index. 1024 is the maximum value... a larger sectorsize creates a larger index file, but nowadays its probably OK to use 1024 bytes for the sectorsize. > > No; flushing has to be done explicitly using f.flush() for this. > > Hmm, but if I write a gigabyte file on a 32Mb computer, the system > has to write out something at some point. Sure; I thought you were talking about "what can I do to be sure that the data gets written to the disk" and that's what .flush() does. > Ok, it might be that this > is 'permanent' and the os writes it to the disk in a hidden mode, > but it becomes 'permanent' with flush. But what happens if there > is a power failure during the flush? Bad thing :-( File/disk corruption is likely. > > Flushing usually refers to writing line buffers out to the > > disk. Whether the file system does write-through or not > > depends on the settings of the file system. It also depends > > on how you open the file, ie. buffered or not. > > Ok, I test BeeBase a bit more and I might not be interested in > those questions anymore ;-) Great :-) -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From haering_postgresql@gmx.de Fri Jan 3 23:15:58 2003 From: haering_postgresql@gmx.de (Gerhard =?iso-8859-1?Q?H=E4ring?=) Date: Sat, 4 Jan 2003 00:15:58 +0100 Subject: [DB-SIG] cursor.description - values for 'I don't know' Message-ID: <20030103231557.GA4066@lilith.ghaering.test> Heya, what's the preferred value for the various fields in the cursor.description tuples when they're not known? -1? 0? None? Yet another issue that the DB-API spec should clarify IMO. Gerhard -- Favourite database: http://www.postgresql.org/ Favourite programming language: http://www.python.org/ Combine the two: http://pypgsql.sf.net/ Embedded database for Python: http://pysqlite.sf.net/ From mal@lemburg.com Fri Jan 3 23:21:40 2003 From: mal@lemburg.com (M.-A. Lemburg) Date: Sat, 04 Jan 2003 00:21:40 +0100 Subject: [DB-SIG] cursor.description - values for 'I don't know' In-Reply-To: <20030103231557.GA4066@lilith.ghaering.test> References: <20030103231557.GA4066@lilith.ghaering.test> Message-ID: <3E161B04.90503@lemburg.com> Gerhard H=E4ring wrote: > Heya, >=20 > what's the preferred value for the various fields in the > cursor.description tuples when they're not known? -1? 0? None? None. > Yet another issue that the DB-API spec should clarify IMO. Doesn't it already ? """ .description This read-only attribute is a sequence of 7-item sequences. Each of these sequences contains information describing one result column: (name, type_code, display_size, internal_size, precision, scale, null_ok). The first two items (name and type_code) are mandatory, the other five are optional and must be set to None if meaningfull values are not provided. """ --=20 Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From haering_postgresql@gmx.de Fri Jan 3 23:35:18 2003 From: haering_postgresql@gmx.de (Gerhard =?iso-8859-1?Q?H=E4ring?=) Date: Sat, 4 Jan 2003 00:35:18 +0100 Subject: [DB-SIG] cursor.description - values for 'I don't know' In-Reply-To: <3E161B04.90503@lemburg.com> References: <20030103231557.GA4066@lilith.ghaering.test> <3E161B04.90503@lemburg.com> Message-ID: <20030103233518.GA4097@lilith.ghaering.test> * M.-A. Lemburg [2003-01-04 00:21 +0100]: > Gerhard Häring wrote: > >Heya, > > > >what's the preferred value for the various fields in the > >cursor.description tuples when they're not known? -1? 0? None? > > None. Thanks. > >Yet another issue that the DB-API spec should clarify IMO. > > Doesn't it already ? > > """ > .description > [...] must be set to None if meaningfull values are not provided. > """ I'll try investigating new ways of making a fool of myself for next time ;-) Gerhard -- Favourite database: http://www.postgresql.org/ Favourite programming language: http://www.python.org/ Combine the two: http://pypgsql.sf.net/ Embedded database for Python: http://pysqlite.sf.net/ From vecernik@aon.at Tue Jan 7 22:48:59 2003 From: vecernik@aon.at (Oliver Vecernik) Date: Tue, 07 Jan 2003 23:48:59 +0100 Subject: [DB-SIG] speedtest Message-ID: <3E1B595B.7030303@aon.at> Hi! As I started playing with Python and the DB-API 2.0 I was interested in a comparison between different open source databases. Reading this newsgroup brought me to SQLite and there I found a nice test written by D. Richard Hipp (http://www.hwaci.com/sw/sqlite/speed.html). I wrote a small Python script (http://members.aon.at/vecernik/download/speedtest.py) for testing PostgreSQL, MySQL (MyISAM, InnoDB, BerkeleyDB), SQLite and SAP DB. I didn't succeed with Firebird, maybe someone else writes a patch. I ran the test on a W2k server (INTEL P4/2GHz, 512MB RAM). You can find my results from the script output (http://members.aon.at/vecernik/download/speedtest.txt) or as csv-format file (http://members.aon.at/vecernik/download/speedtest.csv). The field format should be self explanatory ;-) My results do *not* match very closely with the original ones. :-( I don't know exactly why. PostgreSQL seems to have a memory problem, as test07 grows with every test cycle. Restarting postmaster, solves the problem. SAP DB seems to be quite unstable (to be honest, this is a beta version). Especially when the log runs out of space, it is possible to crash the server! MySQL and SQLite seem to be rock solid. Any comments are welcome! Regards, Oliver From pobrien@orbtech.com Tue Jan 7 19:02:04 2003 From: pobrien@orbtech.com (Patrick K. O'Brien) Date: Tue, 7 Jan 2003 13:02:04 -0600 Subject: [DB-SIG] ANN: Python and DB2 Tutorial Message-ID: <200301071302.04502.pobrien@orbtech.com> My Python and DB2 for Linux tutorial was recently published by IBM: https://www6.software.ibm.com/reg/devworks/dw-db2pylnx-i?S_TACT=102B7W91&S_CMP=DB2DD Python is a great tool to use with DB2. It combines the ability to quickly and simply access a DB2 database with the power to perform more complex tasks that require a general purpose programming language. This tutorial shows you everything you need to know to interact with DB2 V8.1 using the Python programming language. In particular, you'll learn about the Python DB2 module, which allows you to connect to a DB2 database, execute queries, fetch results, and commit or rollback transactions. By the end of the tutorial you will have received a thorough introduction to the entire Python DB2 interface. -- Patrick K. O'Brien Orbtech http://www.orbtech.com/web/pobrien ----------------------------------------------- "Your source for Python programming expertise." ----------------------------------------------- From zen@shangri-la.dropbear.id.au Wed Jan 8 08:07:16 2003 From: zen@shangri-la.dropbear.id.au (Stuart Bishop) Date: Wed, 8 Jan 2003 19:07:16 +1100 Subject: [DB-SIG] Gadfly into Python core - comments? Message-ID: <335CB198-22E0-11D7-B380-000393B63DDC@shangri-la.dropbear.id.au> Do people have any commments on incorporating Gadfly into the standard Python distribution? I feel that it would be a benefit for the following reasons: - Provides a reason for the DB API docs to be merged into the Python library reference - Gives Python relational DB stuff out of the box ala Java, but with a working RDBMS as well ala nothing else I'm aware of. - Makes including GadflyDA in Zope 3 a trivial decision, since its size would be negligable and the DA code itself is already ZPL. Downside would be supporting it. I don't believe Richard Jones could commit time to fixing any issues that turn up from its greater exposure (or indeed the existing issues - see the bugtracker at http://sourceforge.net/tracker/?atid=100662&group_id=662 ). Is anyone aware of bugs that would make it a mistake to rollout the existing version as part of Python 2.3, Python 2.4 or Zope 3? Looking at the existing bug tracker, it would be possible to use the existing version as is by saying 'does not support unique indexes or the group by clause' (and removing them from the grammar as a quick ugly hack). And I think the Unique index bug would be a quick one to fix. Would this be a mistake? Would it be a mistake to include it, but to document it as being anything other than a toy for learning and experimentation? Are there patches out there that never arrived in the Sourceforge bug tracker? Beyond Gadfly, are there other drivers that are in a state to be shipped with Python. I guess criteria would be: - Compatible licence - Stable enough to track with the Python release cycle - Works on both Windows & Unix a bonus. - Wouldn't require reinstalling Python to link in with a newly installed RDBMS client libraries (or is this fine?) One that I can think of may be zxJDBC for the Jython distribution. Other thoughts? I'm asking here as a prelude to discussing this on c.l.p, as I was silly enough to open my big mouth on Zope3-dev and appear to have volunteered for something :-) -- Stuart Bishop http://shangri-la.dropbear.id.au/ From mal@lemburg.com Wed Jan 8 10:18:42 2003 From: mal@lemburg.com (M.-A. Lemburg) Date: Wed, 08 Jan 2003 11:18:42 +0100 Subject: [DB-SIG] speedtest In-Reply-To: <3E1B595B.7030303@aon.at> References: <3E1B595B.7030303@aon.at> Message-ID: <3E1BFB02.8010405@lemburg.com> Oliver Vecernik wrote: > Hi! > > As I started playing with Python and the DB-API 2.0 I was interested in > a comparison between different open source databases. Reading this > newsgroup brought me to SQLite and there I found a nice test written by > D. Richard Hipp (http://www.hwaci.com/sw/sqlite/speed.html). > > I wrote a small Python script > (http://members.aon.at/vecernik/download/speedtest.py) for testing > PostgreSQL, MySQL (MyISAM, InnoDB, BerkeleyDB), SQLite and SAP DB. I > didn't succeed with Firebird, maybe someone else writes a patch. > > I ran the test on a W2k server (INTEL P4/2GHz, 512MB RAM). You can find > my results from the script output > (http://members.aon.at/vecernik/download/speedtest.txt) or as csv-format > file (http://members.aon.at/vecernik/download/speedtest.csv). The field > format should be self explanatory ;-) > > My results do *not* match very closely with the original ones. :-( > > I don't know exactly why. PostgreSQL seems to have a memory problem, as > test07 grows with every test cycle. Restarting postmaster, solves the > problem. SAP DB seems to be quite unstable (to be honest, this is a beta > version). Especially when the log runs out of space, it is possible to > crash the server! It doesn't crash the server: when the log is full, the database does an emergency shutdown to prevent data loss. You have to enable autolog for SAP DB so that the log can be automatically backed up and then cleared. Logs like the one SAP DB creates are needed to assure transaction security and to make sure that the database remains in a clean state. > MySQL and SQLite seem to be rock solid. The choice of database depends on your needs. MySQL and SQLite don't offer a complete set of SQL features. OTOH, you may not need them. Then again, SAP DB and PostgreSQL don't have any problem creating GB-size databases which is something MySQL and SQLite are not up to. You'll probably also find that those two don't scale very well. Anyway, that's my experience. YMMV. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From Anthony Baxter Wed Jan 8 11:00:10 2003 From: Anthony Baxter (Anthony Baxter) Date: Wed, 08 Jan 2003 22:00:10 +1100 Subject: [DB-SIG] Gadfly into Python core - comments? In-Reply-To: <335CB198-22E0-11D7-B380-000393B63DDC@shangri-la.dropbear.id.au> Message-ID: <200301081100.h08B0AC03373@localhost.localdomain> >>> Stuart Bishop wrote > > Do people have any commments on incorporating Gadfly into the standard > Python distribution? The major concern I'd have is that the code's got some ... idiosyncrasies. It is based on kjbuckets (well, it is if you want something that doesn't suck utterly for performance). It would be nice if it used the python2.3 'sets' module. On the other hand, python's shipped with dumbdbm for yonks, and before 2.1.2, it was almost _im_possible to use that without causing data corruption, and it's still abysmally slow today. I don't think there's much chance of this being done in time for 2.3, but for 2.4 it should be possible. I'm also not sure off the top of my head how much of the DB-API is actually supported by gadfly. -- Anthony Baxter It's never too late to have a happy childhood. From magnus@thinkware.se Wed Jan 8 23:12:22 2003 From: magnus@thinkware.se (Magnus Lycka) Date: Thu, 09 Jan 2003 00:12:22 +0100 Subject: [DB-SIG] Gadfly into Python core - comments? In-Reply-To: <335CB198-22E0-11D7-B380-000393B63DDC@shangri-la.dropbear.i d.au> Message-ID: <5.1.0.14.0.20030108234407.02c73d20@www.thinkware.se> At 19:07 2003-01-08 +1100, Stuart Bishop wrote: >Do people have any commments on incorporating Gadfly into the standard >Python distribution? I've been thinking the same thing. Another thought that crossed my mind was to include support for SQLite instead. That's not a database written in Python, but it's a similar, simple, embedded SQL subset thingie that can be used freely and doesn't require any server setup etc. I think they both work more or less equally well for prototyping and single user applications etc. AFAIK, SQLite implements a somewhat larger subset of SQL (at least it supports LIKE!), and it's in the Public Domain, with the python interface using the Python Licence. Since Gadfly is maintained again, it might be a more viable choice than it was a year ago or so, but as you note, it's still a maintenace effort. SQLite is maintained by someone else, and I'm pretty sure it has a userbase which is much larger than Gadfly. Thus the maintenace effort of including SQLite is restricted to a fairly simple DB API implementation and the inclusion of a rather small third party product, much as with zlib etc today. SQLite also has additional benefits such as a standalone SQL monitor etc. -- Magnus Lycka, Thinkware AB Alvans vag 99, SE-907 50 UMEA, SWEDEN phone: int+46 70 582 80 65, fax: int+46 70 612 80 65 http://www.thinkware.se/ mailto:magnus@thinkware.se From zen@shangri-la.dropbear.id.au Thu Jan 9 01:56:57 2003 From: zen@shangri-la.dropbear.id.au (Stuart Bishop) Date: Thu, 9 Jan 2003 12:56:57 +1100 Subject: [DB-SIG] Gadfly into Python core - comments? In-Reply-To: <5.1.0.14.0.20030108234407.02c73d20@www.thinkware.se> Message-ID: On Thursday, January 9, 2003, at 10:12 AM, Magnus Lycka wrote: > Since Gadfly is maintained again, it might be a more viable choice > than it was a year ago or so, but as you note, it's still a maintenace Richard put the effort into pushing out another release, incorporating various patches and probably some of his own work, but I wouldn't call it actively maintained. > effort. SQLite is maintained by someone else, and I'm pretty sure it > has a userbase which is much larger than Gadfly. Thus the maintenace > effort of including SQLite is restricted to a fairly simple DB API > implementation and the inclusion of a rather small third party product, > much as with zlib etc today. > > SQLite also has additional benefits such as a standalone SQL monitor > etc. This is interesting. On Sourceforge, it lists itself as 'beta' quality, and from the home page: There are currently two developers on this project, both of which are very busy doing other things. If you would like to contribute to this project, be it coding, testing, documenting, or other, we welcome your contribution. Any thoughts if this is a solid enough beta to be an alternative or an addition to shipping Python with Gadfly? Actually, it would have to be in addition as there doesn't seem to be a Zope DA available for it which is a motivator for this. -- Stuart Bishop http://shangri-la.dropbear.id.au/ From Anthony Baxter Thu Jan 9 02:45:53 2003 From: Anthony Baxter (Anthony Baxter) Date: Thu, 09 Jan 2003 13:45:53 +1100 Subject: [DB-SIG] Gadfly into Python core - comments? In-Reply-To: <5.1.0.14.0.20030108234407.02c73d20@www.thinkware.se> Message-ID: <200301090245.h092jse16252@localhost.localdomain> >>> Magnus Lycka wrote > I've been thinking the same thing. Another thought that crossed my > mind was to include support for SQLite instead. That's not a database > written in Python, but it's a similar, simple, embedded SQL subset > thingie that can be used freely and doesn't require any server setup > etc. I think they both work more or less equally well for prototyping > and single user applications etc. To my mind, gadfly being written in python has a couple of benefits: It will work in Jython without modification It will work on all platforms without modification We're unlikely to distribute SQLite itself with Python, so that's an additional thing for people to fetch and download. Unlike Berkeley DB, this isn't something that's likely to already be on a system. > AFAIK, SQLite implements a somewhat larger subset of SQL (at least it > supports LIKE!), and it's in the Public Domain, with the python interface > using the Python Licence. The licensing issue is addressable. Hopefully Aaron will be amenable to re-releasing GF under the Python license. (Has anyone emailed him to ask?) > Since Gadfly is maintained again, it might be a more viable choice > than it was a year ago or so, but as you note, it's still a maintenace > effort. SQLite is maintained by someone else, and I'm pretty sure it > has a userbase which is much larger than Gadfly. Thus the maintenace > effort of including SQLite is restricted to a fairly simple DB API > implementation and the inclusion of a rather small third party product, > much as with zlib etc today. But zlib doesn't ship with python (afaik), we just ship the interface, and assume that most platforms have it. Shipping SQLite itself inside python means that we need to track the SQLite code, updating the version inside python when there's changes to the original source. Not a good idea. The userbase issue isn't (to me) a huge one - the idea here is that we have a minimal baseline DB interface. Anthony -- Anthony Baxter It's never too late to have a happy childhood. From ramrom@earthling.net Thu Jan 9 02:59:42 2003 From: ramrom@earthling.net (Bob Gailer) Date: Wed, 08 Jan 2003 19:59:42 -0700 Subject: [DB-SIG] Using SQLite from Python In-Reply-To: <5.1.0.14.0.20030108234407.02c73d20@www.thinkware.se> References: <335CB198-22E0-11D7-B380-000393B63DDC@shangri-la.dropbear.i d.au> Message-ID: <5.2.0.9.0.20030108195538.02a406b0@66.28.54.253> --=======4E1B5AC7======= Content-Type: text/plain; x-avg-checked=avg-ok-2C5849C1; charset=us-ascii; format=flowed Content-Transfer-Encoding: 8bit At 12:12 AM 1/9/2003 +0100, Magnus Lycka wrote: ... SQLite ... I downloaded SQLite and pysqlite. (As usual) there's no documentation telling me what to do to use pysqlite. Could someone give me a hand? I got the SQLite console running OK; what I don't know is how to incorporate SQLite into a python program Bob Gailer mailto:ramrom@earthling.net 303 442 2625 --=======4E1B5AC7======= Content-Type: text/plain; charset=us-ascii; x-avg=cert; x-avg-checked=avg-ok-2C5849C1 Content-Disposition: inline --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.438 / Virus Database: 246 - Release Date: 1/7/2003 --=======4E1B5AC7=======-- From db-sig@python.org Thu Jan 9 03:15:06 2003 From: db-sig@python.org (Gerhard =?iso-8859-1?Q?H=E4ring?=) Date: Thu, 9 Jan 2003 04:15:06 +0100 Subject: [DB-SIG] Using SQLite from Python In-Reply-To: <5.2.0.9.0.20030108195538.02a406b0@66.28.54.253> References: <335CB198-22E0-11D7-B380-000393B63DDC@shangri-la.dropbear.id.au> <5.2.0.9.0.20030108195538.02a406b0@66.28.54.253> Message-ID: <20030109031506.GA1024@lilith.ghaering.test> * Bob Gailer [2003-01-08 19:59 -0700]: > At 12:12 AM 1/9/2003 +0100, Magnus Lycka wrote: > ... SQLite ... > > I downloaded SQLite and pysqlite. (As usual) there's no documentation > telling me what to do to use pysqlite. Documentation is available here (also downloadable): http://pysqlite.sourceforge.net/documentation/index.html (The source distribution only contains the plain LaTex files from which these docs are created.) > Could someone give me a hand? I got the SQLite console running OK; > what I don't know is how to incorporate SQLite into a python program Well, "import sqlite", for starters ;-) Here's a quick example: #v+ import sqlite con = sqlite.connect("mydatabasefile") cursor = con.cursor() cursor.execute("create table test(id, name)") cursor.execute("insert into test(id, name) values (%s, %s)", (42, "foo")) cursor.execute("pysqlite_pragma expected_types = int, str") cursor.execute("select id, name from test") print cursor.fetchone() con.close() #v- pysqlite_pragma is needed if you want to retrieve something other than strings, check the docs for details. Btw. it occured to me today that we should rather use something like "-- pysqlite_pragma" instead, so SQL code can be written more portably across databases. HTH, Gerhard -- Favourite database: http://www.postgresql.org/ Favourite programming language: http://www.python.org/ Combine the two: http://pypgsql.sf.net/ Embedded database for Python: http://pysqlite.sf.net/ From mmclay@comcast.net Thu Jan 9 05:21:10 2003 From: mmclay@comcast.net (Michael McLay) Date: Thu, 09 Jan 2003 00:21:10 -0500 Subject: [DB-SIG] Looking for objections to adding decimal numbers to Python In-Reply-To: <200212200758.25026.mmclay@comcast.net> References: <200212200758.25026.mmclay@comcast.net> Message-ID: <200301090021.10473.mmclay@comcast.net> On Friday 20 December 2002 07:58 am, Michael McLay wrote: > There has been a discusion of adding a "decimal" number type to core > distribution on the python-dev mailing list over the past couple weeks. > This new type would likely be used most often for financial data that is > stored in SQL databases. Tim Peters describes two different types of > decimal numbers in the forwarded message that is attached to this message. > I do not have the insight into the typical SQL database use of decimal > numbers. Are they the fixed point type numbers that Tim has implemented in > FixedType (with "banker" rounding properties), or are they the Cowlishhaw > float numbers as described by Tim? My objective in pushing for adding a > decimal type is to have useful decimal numbers that for manipulating data > from SQL databases added to Python, I'd like to make sure those numbers > have the right semantics for that goal. > > Comments? Should FixedPoint [1] be added to the standard distribution? If now, why not? The deafening silence suggests either a lack of interest, or poor timing by asking the question just before a holiday. I hope it was the latter. I think Python deserves a number type that is usable by the financial community. Guido has put off any syntax changes, but at the vary least Python 2.3 should consider adding a "batteries included" module that provides a decimal number capability. It is hard to believe that something that is so fundamental to financial data manipulation can attract less interest than the the addition of the reST module to the standard distribution. Please look at http://fixedpoint.sourceforge.net/ and weigh in on the correctness of this module for use in financial calculations. It is hard to believe that you object to the algorithms used in the implementation of this module (it was written by Tim Peters.) So if you object, please provide some clue as to why FixedPoint doesn't meet your requirements. [1] http://fixedpoint.sourceforge.net/ From vecernik@aon.at Thu Jan 9 08:05:25 2003 From: vecernik@aon.at (Oliver Vecernik) Date: Thu, 09 Jan 2003 09:05:25 +0100 Subject: [DB-SIG] Re: Using SQLite from Python References: <335CB198-22E0-11D7-B380-000393B63DDC@shangri-la.dropbear.id.au> <5.2.0.9.0.20030108195538.02a406b0@66.28.54.253> <20030109031506.GA1024@lilith.ghaering.test> Message-ID: <3E1D2D45.20409@aon.at> Gerhard H=E4ring schrieb: > [...] > Btw. it occured to me today that we should rather use something like > "-- pysqlite_pragma" instead, so SQL code can be written more portably > across databases. Very good idea, in my opinion. BTW: I can specify types for sqlite as an = option (I know it's not used, but encouraged to do it for=20 clarification). Is there a special reason (e.g. speed) for pysqlite not=20 to use this information, if provided? It would be convenient! Oliver From mal@lemburg.com Thu Jan 9 10:54:26 2003 From: mal@lemburg.com (M.-A. Lemburg) Date: Thu, 09 Jan 2003 11:54:26 +0100 Subject: [DB-SIG] Looking for objections to adding decimal numbers to Python In-Reply-To: <200301090021.10473.mmclay@comcast.net> References: <200212200758.25026.mmclay@comcast.net> <200301090021.10473.mmclay@comcast.net> Message-ID: <3E1D54E2.5010300@lemburg.com> [this discussion should take place on python-dev rather than db-sig] Michael McLay wrote: > On Friday 20 December 2002 07:58 am, Michael McLay wrote: > >>There has been a discusion of adding a "decimal" number type to core >>distribution on the python-dev mailing list over the past couple weeks. >>This new type would likely be used most often for financial data that is >>stored in SQL databases. Tim Peters describes two different types of >>decimal numbers in the forwarded message that is attached to this message. >>I do not have the insight into the typical SQL database use of decimal >>numbers. Are they the fixed point type numbers that Tim has implemented in >>FixedType (with "banker" rounding properties), or are they the Cowlishhaw >>float numbers as described by Tim? My objective in pushing for adding a >>decimal type is to have useful decimal numbers that for manipulating data >>from SQL databases added to Python, I'd like to make sure those numbers >>have the right semantics for that goal. >> >>Comments? > > > Should FixedPoint [1] be added to the standard distribution? If now, why not? > > The deafening silence suggests either a lack of interest, or poor timing by > asking the question just before a holiday. I hope it was the latter. I think > Python deserves a number type that is usable by the financial community. > Guido has put off any syntax changes, but at the vary least Python 2.3 should > consider adding a "batteries included" module that provides a decimal number > capability. > > It is hard to believe that something that is so fundamental to financial data > manipulation can attract less interest than the the addition of the reST > module to the standard distribution. Please look at > http://fixedpoint.sourceforge.net/ and weigh in on the correctness of this > module for use in financial calculations. It is hard to believe that you > object to the algorithms used in the implementation of this module (it was > written by Tim Peters.) So if you object, please provide some clue as to why > FixedPoint doesn't meet your requirements. > > [1] http://fixedpoint.sourceforge.net/ I suppose for it to be useful for databas processing some things are still missing: * a change in the name: FixedPoint is simply to long; decimal would be much nicer, IMHO * the constructor decimal() should become a Python built-in * an implementation in C (preferably as new style class) * a C API which is then made available via Python.h * an upgrade path for existing DB API modules, such that switching to FixedPoint from floats is seemless for users of the new data type * the C type should be a subclass of float, if possible -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From adamrich@skunkworksone.com Thu Jan 9 11:08:15 2003 From: adamrich@skunkworksone.com (Adam Richardson) Date: Thu, 9 Jan 2003 11:08:15 +0000 Subject: [DB-SIG] Porting Lasso / mySQL / Oracle solutions to Python Message-ID: Hi All, List newbie here, so apologies if this is the wrong list to post this to. We're currently assessing Python for middleware needs for various projects, chiefly with mySQL or Oracle db's. We currently use Lasso with a combination of the Corral Method / FrameWork Pro, so I'm wondering if there are any developers on the list who know both Lasso and Python who might be able to answer a few questions I have about porting Lasso solutions to Python. Thanks in advance, Adam -- -------------------------- Adam Richardson, CEO Skunkworks One Database, Web Development and Data Security Consultants 30 Chandos Street, St. Leonards, Sydney, NSW 2065 Australia Ph: +61 2 9439 8600 Fax: +61 2 9437 4584 http://www.SkunkworksOne.com SkunkWorks One specialises in developing databases, e-commerce and business systems, with our number one priority being to secure those systems with the data security that today's business environment demands. "The U.S. General Accounting Office (GAO) reports that about 250,000 break-ins into Federal computer systems were attempted in one year and 64 percent were successful. The number of attacks is doubling every year and the GAO estimates that only one to four percent of these attacks will be detected and only about one percent will be reported." The contents of this e-mail and any attachment(s) are strictly confidential and are solely for the person(s) at the e-mail address(es) above. Skunkworks One is a division of Waenick Pty. Ltd. From ramrom@earthling.net Thu Jan 9 17:40:45 2003 From: ramrom@earthling.net (Bob Gailer) Date: Thu, 09 Jan 2003 10:40:45 -0700 Subject: [DB-SIG] Looking for objections to adding decimal numbers to Python In-Reply-To: <200301090021.10473.mmclay@comcast.net> References: <200212200758.25026.mmclay@comcast.net> <200212200758.25026.mmclay@comcast.net> Message-ID: <5.2.0.9.0.20030109103911.01a04ab8@66.28.54.253> --=======48A32A01======= Content-Type: text/plain; x-avg-checked=avg-ok-1BA33EF8; charset=us-ascii; format=flowed Content-Transfer-Encoding: 8bit At 12:21 AM 1/9/2003 -0500, Michael McLay wrote: > Please look at http://fixedpoint.sourceforge.net/ OK I did that. > and weigh in on the correctness of this module for use in financial calculations. What is the appropriate mechanism for responding? Bob Gailer mailto:ramrom@earthling.net 303 442 2625 --=======48A32A01======= Content-Type: text/plain; charset=us-ascii; x-avg=cert; x-avg-checked=avg-ok-1BA33EF8 Content-Disposition: inline --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.438 / Virus Database: 246 - Release Date: 1/7/2003 --=======48A32A01=======-- From haering_postgresql@gmx.de Thu Jan 9 22:52:58 2003 From: haering_postgresql@gmx.de (Gerhard =?iso-8859-1?Q?H=E4ring?=) Date: Thu, 9 Jan 2003 23:52:58 +0100 Subject: [DB-SIG] Re: Using SQLite from Python In-Reply-To: <3E1D2D45.20409@aon.at> References: <335CB198-22E0-11D7-B380-000393B63DDC@shangri-la.dropbear.id.au> <5.2.0.9.0.20030108195538.02a406b0@66.28.54.253> <20030109031506.GA1024@lilith.ghaering.test> <3E1D2D45.20409@aon.at> Message-ID: <20030109225257.GA642@lilith.ghaering.test> * Oliver Vecernik [2003-01-09 09:05 +0100]: > Gerhard Häring schrieb: > >[...] > >Btw. it occured to me today that we should rather use something like > >"-- pysqlite_pragma" instead, so SQL code can be written more portably > >across databases. > > Very good idea, in my opinion. BTW: I can specify types for sqlite as an > option (I know it's not used, but encouraged to do it for > clarification). > Is there a special reason (e.g. speed) for pysqlite not to use this > information, if provided? It would be convenient! Actually, since SQLite 2.5.6 we can get some type information when we use "pragma show datatypes=ON". Unfortunately, that support is broken in the current PySQLite release (at least the SQLite version check, so it will only work with 2.5.x). In theory this SQLite pragma can save many uses of "pysqlite_pragma expected types" in the future, but not right now. I'm at this moment experimenting with a more or less complete rewrite of PySQLite that will move lots of code into the Python layer instead of the C layer, to make things more manageable :-) Gerhard -- Favourite database: http://www.postgresql.org/ Favourite programming language: http://www.python.org/ Combine the two: http://pypgsql.sf.net/ Embedded database for Python: http://pysqlite.sf.net/ From david@sundayta.com Fri Jan 10 23:01:58 2003 From: david@sundayta.com (David Warnock) Date: Fri, 10 Jan 2003 23:01:58 +0000 Subject: [DB-SIG] Looking for objections to adding decimal numbers to Python In-Reply-To: <200301090021.10473.mmclay@comcast.net> References: <200212200758.25026.mmclay@comcast.net> <200301090021.10473.mmclay@comcast.net> Message-ID: <3E1F50E6.7040004@sundayta.com> Michael, > Should FixedPoint [1] be added to the standard distribution? If now, why not? Yes please. > The deafening silence suggests either a lack of interest, or poor timing by > asking the question just before a holiday. I hope it was the latter. Latter for me. > I think > Python deserves a number type that is usable by the financial community. Yes please. -- David Warnock, Sundayta Ltd. http://www.sundayta.com iDocSys for Document Management. VisibleResults for Fundraising. Development and Hosting of Web Applications and Sites. From ldl@ldl.HealthPartners.com Mon Jan 13 18:52:28 2003 From: ldl@ldl.HealthPartners.com (LD Landis) Date: Mon, 13 Jan 2003 12:52:28 -0600 (CST) Subject: [DB-SIG] Re the addition of decimal numbers to python In-Reply-To: <20030111170003.17508.40299.Mailman@mail.python.org> from "db-sig-request@python.org" at Jan 11, 2003 12:00:03 PM Message-ID: <200301131852.h0DIqSY07834@ldl.HealthPartners.com> Hi, Decimal numbers (in Python) would be very useful! Forwarded message: > Date: Sat, 11 Jan 2003 12:00:03 -0500 > From: db-sig-request@python.org > Subject: DB-SIG digest, Vol 1 #747 - 2 msgs > > Michael, > > > Should FixedPoint [1] be added to the standard distribution? If now, > > why not? > > Yes please. > > > The deafening silence suggests either a lack of interest, or poor timing > > by asking the question just before a holiday. I hope it was the latter. > > Latter for me. > > > I think > > Python deserves a number type that is usable by the financial community. > > Yes please. > > -- > David Warnock, Sundayta Ltd. http://www.sundayta.com > iDocSys for Document Management. VisibleResults for Fundraising. > Development and Hosting of Web Applications and Sites. > From ramrom@earthling.net Mon Jan 13 19:59:43 2003 From: ramrom@earthling.net (Bob Gailer) Date: Mon, 13 Jan 2003 12:59:43 -0700 Subject: [DB-SIG] Re the addition of decimal numbers to python In-Reply-To: <200301131852.h0DIqSY07834@ldl.HealthPartners.com> References: <20030111170003.17508.40299.Mailman@mail.python.org> Message-ID: <5.2.0.9.0.20030113125120.02d19b18@66.28.54.253> --=======2D031787======= Content-Type: text/plain; x-avg-checked=avg-ok-7DC63855; charset=us-ascii; format=flowed Content-Transfer-Encoding: 8bit I too favor adding decimal numbers to Python. In the older mainframe days the IBM 360 and following computers had an internal representation called packed decimal; storing 2 hex representations of decimal digits per byte; the rightmost byte conveyed the sign. The hardware included instructions for doing arithmetic on packed decimal, and the PL/I language provided high-level resources for declaring and manipulating decimal data. Since each digit was represented separately there was no issue of loss of precision of fractional data. I have seen several articles discussing various ways of storing deciomal digits compactly. But the bottom line is: decimal data can easily be represented as integer with precision. As a further aside, at one APL conference there was a discussion about the value of complex numbers; one man said "I'm an accountant. We certainly can benefit from imaginary numbers." Bob Gailer mailto:ramrom@earthling.net 303 442 2625 --=======2D031787======= Content-Type: text/plain; charset=us-ascii; x-avg=cert; x-avg-checked=avg-ok-7DC63855 Content-Disposition: inline --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.438 / Virus Database: 246 - Release Date: 1/7/2003 --=======2D031787=======-- From david@sundayta.com Tue Jan 14 09:27:22 2003 From: david@sundayta.com (David Warnock) Date: Tue, 14 Jan 2003 09:27:22 +0000 Subject: [DB-SIG] Re the addition of decimal numbers to python In-Reply-To: <5.2.0.9.0.20030113125120.02d19b18@66.28.54.253> References: <20030111170003.17508.40299.Mailman@mail.python.org> <5.2.0.9.0.20030113125120.02d19b18@66.28.54.253> Message-ID: <3E23D7FA.9070305@sundayta.com> Bob, > But the bottom line is: decimal data can easily be represented as > integer with precision. Yes, but when you need to do calculations with mixed numbers of decimal places eg Jordanian Dinars (3dp) via Rate of Exchange (4dp) into $ (2dp) working with integers only is a pain. This is where fixedpoint is really helpful. Regards Dave From ramrom@earthling.net Tue Jan 14 16:21:45 2003 From: ramrom@earthling.net (Bob Gailer) Date: Tue, 14 Jan 2003 09:21:45 -0700 Subject: [DB-SIG] Re the addition of decimal numbers to python In-Reply-To: <3E23D7FA.9070305@sundayta.com> References: <5.2.0.9.0.20030113125120.02d19b18@66.28.54.253> <20030111170003.17508.40299.Mailman@mail.python.org> <5.2.0.9.0.20030113125120.02d19b18@66.28.54.253> Message-ID: <5.2.0.9.0.20030114091445.03458250@66.28.54.253> --=======70752F57======= Content-Type: text/plain; x-avg-checked=avg-ok-3DBD71BC; charset=us-ascii; format=flowed Content-Transfer-Encoding: 8bit At 09:27 AM 1/14/2003 +0000, David Warnock wrote: >>But the bottom line is: decimal data can easily be represented as integer >>with precision. > >Yes, but when you need to do calculations with mixed numbers of decimal >places eg Jordanian Dinars (3dp) via Rate of Exchange (4dp) into $ (2dp) >working with integers only is a pain. This is where fixedpoint is really >helpful. Sorry; my intent was to convey: Class FixedPoint: def __init__(self, value, precision): self.value = value # as an integer self.precision = precision # number of places to right of decimal point # other methods to perform the arithmetic Bob Gailer mailto:ramrom@earthling.net 303 442 2625 --=======70752F57======= Content-Type: text/plain; charset=us-ascii; x-avg=cert; x-avg-checked=avg-ok-3DBD71BC Content-Disposition: inline --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.438 / Virus Database: 246 - Release Date: 1/7/2003 --=======70752F57=======-- From david@sundayta.com Tue Jan 14 16:27:50 2003 From: david@sundayta.com (David Warnock) Date: Tue, 14 Jan 2003 16:27:50 +0000 Subject: [DB-SIG] Re the addition of decimal numbers to python In-Reply-To: <5.2.0.9.0.20030114091445.03458250@66.28.54.253> References: <5.2.0.9.0.20030113125120.02d19b18@66.28.54.253> <20030111170003.17508.40299.Mailman@mail.python.org> <5.2.0.9.0.20030113125120.02d19b18@66.28.54.253> <5.2.0.9.0.20030114091445.03458250@66.28.54.253> Message-ID: <3E243A86.6010601@sundayta.com> Bob, > Sorry; my intent was to convey: > > Class FixedPoint: > def __init__(self, value, precision): > self.value = value # as an integer > self.precision = precision # number of places to right of decimal point > # other methods to perform the arithmetic Cool, in that case we agree. FixedPoint rules and is required for all serious work ;-) More seriously I am continually surprised when languages don't support this data type by default as I write very few applications where it is not needed. Dave -- David Warnock, Sundayta Ltd. http://www.sundayta.com iDocSys for Document Management. VisibleResults for Fundraising. Development and Hosting of Web Applications and Sites. From webmaster@pferdemarkt.ws Wed Jan 15 12:23:03 2003 From: webmaster@pferdemarkt.ws (webmaster@pferdemarkt.ws) Date: Wed, 15 Jan 2003 04:23:03 -0800 Subject: [DB-SIG] Pferdemarkt.ws informiert! Newsletter 01/2003 Message-ID: <200301151223.EAA00878@eagle.he.net> http://www.pferdemarkt.ws Wir sind in 2003 erfolgreich in des neue \"Pferdejahr 2003 gestartet. Für den schnellen Erfolg unseres Marktes möchten wir uns bei Ihnen bedanken. Heute am 15. Januar 2003 sind wir genau 14 Tage Online! Täglich wächst unsere Datenbank um ca. 30 neue Angebote. Stellen auch Sie als Privatperson Ihre zu verkaufenden Pferde direkt und vollkommen Kostenlos ins Internet. Zur besseren Sichtbarmachung Ihrer Angebote können SIe bis zu ein Bild zu Ihrer Pferdeanzeige kostenlos einstellen! Klicken Sie hier um sich direkt einzuloggen http://www.Pferdemarkt.ws Kostenlos Anbieten, Kostenlos Suchen! Direkt von Privat zu Privat! Haben Sie noch Fragen mailto: webmaster@pferdemarkt.ws From djc@object-craft.com.au Thu Jan 23 10:37:08 2003 From: djc@object-craft.com.au (Dave Cole) Date: 23 Jan 2003 21:37:08 +1100 Subject: [DB-SIG] Sybase module 0.36pre3 released Message-ID: WHAT IS IT: The Sybase module provides a Python interface to the Sybase relational database system. It supports all of the Python Database API, version 2.0 with extensions. NOTES: This is another incremental improvement to FreeTDS support. You can build for FreeTDS like this: python setup.py build_ext -D HAVE_FREETDS -U WANT_BULKCOPY python setup.py install The module is available here: http://www.object-craft.com.au/projects/sybase/download/sybase-0.36pre3.tar.gz The module home page is here: http://www.object-craft.com.au/projects/sybase/ CHANGES SINCE 0.35: * Removed references to CS_PENDING and CS_BUSY in Sybase.py. * Bind CS_VARBINARY_TYPE as CS_BINARY_TYPE. * Do not attempt to ct_cancel() when handling an exception if have not connected to the server. Bug fix in Sybase.py. * Seems like FreeTDS reports the wrong maxlength in ct_describe() for CS_NUMERIC_TYPE and CS_DECIMAL_TYPE. Ignore FreeTDS and assume a maxlength of sizeof(CS_NUMERIC). Bugfix in databuf.c. * Use correct T_STRING_INPLACE type in structure member descriptions. The code does not use Python API for these members. * Debug output for DataFmt now includes scale and precision. * More definitions added to freetds.h; CS_SRC_VALUE, CS_CLEAR. -- http://www.object-craft.com.au From dieter@handshake.de Fri Jan 24 11:08:47 2003 From: dieter@handshake.de (Dieter Maurer) Date: Fri, 24 Jan 2003 12:08:47 +0100 Subject: [DB-SIG] Severe Postgres problems Message-ID: <15921.7871.236566.424482@gargle.gargle.HOWL> We observe the following severe problem with PostgreSQL 7.2.1: SQL selects return non-deterministically an empty result set (while we know, the correct result set is non-empty). My colleague did some Google search and found out that this is a problem observed by several PostgreSQL users. In some error situations (when many "operations ignored until transaction reset" appear in the PostgreSQL log file), Postgres forgets to set correct error information. Requests seem to succeed with 0 rows affected instead of an error indication. Apparently, the problem is related to the duration Postgres is running. After a restart, the problem occurs only rarely. Later, the occurrence frequency increases and can finally be quite high. We will soon switch to PostgreSQL 7.3.1 and hope the problem is solved there. I will keep you informed. Does anybody already have experience with PostgresSQL 7.3.1 and especially "psycopg" and this postgres version? Dieter From jacobs@penguin.theopalgroup.com Fri Jan 24 11:44:23 2003 From: jacobs@penguin.theopalgroup.com (Kevin Jacobs) Date: Fri, 24 Jan 2003 06:44:23 -0500 (EST) Subject: [DB-SIG] Severe Postgres problems In-Reply-To: <15921.7871.236566.424482@gargle.gargle.HOWL> Message-ID: On Fri, 24 Jan 2003, Dieter Maurer wrote: > Does anybody already have experience with PostgresSQL 7.3.1 > and especially "psycopg" and this postgres version? We use 7.3.1 with psycopg in many large applications and have had no problems with bad data being returned. The only problem we've seen with 7.3.1 is with SSL connections, though that was fixed by a patch that will be in 7.3.2. So I can recommend both without reservation. Regards, -Kevin -- Kevin Jacobs The OPAL Group - Enterprise Systems Architect Voice: (216) 986-0710 x 19 E-mail: jacobs@theopalgroup.com Fax: (216) 986-0714 WWW: http://www.theopalgroup.com From andrew@logicalprogression.net Fri Jan 24 12:31:43 2003 From: andrew@logicalprogression.net (Andrew Veitch) Date: Fri, 24 Jan 2003 12:31:43 +0000 Subject: [DB-SIG] Re: [Zope-DB] Severe Postgres problems In-Reply-To: <15921.7871.236566.424482@gargle.gargle.HOWL> Message-ID: On 24/1/03 11:08 am, "Dieter Maurer" wrote: > Does anybody already have experience with PostgresSQL 7.3.1 > and especially "psycopg" and this postgres version? We do and it's been fine. Although this is just on a test machine which hasn't yet been put into real service yet but it's certainly passed our stress tests. A From ramrom@earthling.net Sat Jan 25 02:14:11 2003 From: ramrom@earthling.net (Bob Gailer) Date: Fri, 24 Jan 2003 19:14:11 -0700 Subject: [DB-SIG] ODBC dbiDate and Date() problems In-Reply-To: <44691.195.53.212.39.1029501945.squirrel@www.grupoburke.com > Message-ID: <5.2.0.9.0.20030124184915.01a07240@66.28.54.253> --=======55995B48======= Content-Type: text/plain; x-avg-checked=avg-ok-344735FE; charset=us-ascii; format=flowed Content-Transfer-Encoding: 8bit I defined an ODBC System data source in the Windows 2000 ODBC Data Source Administrator named "foo" using the Microsoft FoxPro VFP Driver (*.dbf). >>> import odbc >>> conn = odbc.odbc("foo") >>> curs = conn.cursor() >>> curs.execute("select start_time from foo") >>> row = curs.fetchone() >>> row[0] Now what do I do with this object. What are its methods/properties? I have searched the documentation; there's no reference to odbc in the library index or the module index; the DB api specs don't address the issue, and searching the Python Site also returns nothing helpful. Even the Python 2.1 Bible doesn't address the issue. Where should I be looking for the documentation.? This is really confusing. It seems to me it should be easy to find this. What am I missing? I tried: >>> dir(row[0]) [] >>> r.__class__ ...attribute error >>> str(r) 'Fri Jan 24 14:55:09 2003' Finally something useful, but that's a lot of experimenting. Also having no luck using odbc.Date() to send a timestamp back. Where does one get and put the function? To all of the following I get the same exception: >>> odbc.Date >>> odbc.date >>> odbc.odbc.Date >>> odbc.odbc.date Traceback (most recent call last): File "", line 1, in ? AttributeError: ... Bob Gailer mailto:ram rom@earthling.net 303 442 2625 --=======55995B48======= Content-Type: text/plain; charset=us-ascii; x-avg=cert; x-avg-checked=avg-ok-344735FE Content-Disposition: inline --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.445 / Virus Database: 250 - Release Date: 1/21/2003 --=======55995B48=======-- From magnus@thinkware.se Sun Jan 26 04:35:29 2003 From: magnus@thinkware.se (Magnus Lycka) Date: Sun, 26 Jan 2003 05:35:29 +0100 Subject: [DB-SIG] ODBC dbiDate and Date() problems In-Reply-To: <5.2.0.9.0.20030124184915.01a07240@66.28.54.253> References: <44691.195.53.212.39.1029501945.squirrel@www.grupoburke.com > Message-ID: <5.1.0.14.0.20030126052100.02c0d6a8@www.thinkware.se> At 19:14 2003-01-24 -0700, Bob Gailer wrote: > > >Now what do I do with this object. What are its methods/properties? The name of the class is a hint... >>> import dbi, time >>> help(dbi) ... >>> print dbi.dbiDate(time.time()) Sun Jan 26 05:20:40 2003 Oops, I should sleep a bit.. See also: http://www.python.org/windows/OdbcHints.html http://www.python.org/windows/win32/odbc.html -- Magnus Lycka, Thinkware AB Alvans vag 99, SE-907 50 UMEA, SWEDEN phone: int+46 70 582 80 65, fax: int+46 70 612 80 65 http://www.thinkware.se/ mailto:magnus@thinkware.se From ramrom@earthling.net Sun Jan 26 16:06:49 2003 From: ramrom@earthling.net (Bob Gailer) Date: Sun, 26 Jan 2003 09:06:49 -0700 Subject: [DB-SIG] ODBC dbiDate and Date() problems In-Reply-To: <5.1.0.14.0.20030126052100.02c0d6a8@www.thinkware.se> References: <5.2.0.9.0.20030124184915.01a07240@66.28.54.253> <44691.195.53.212.39.1029501945.squirrel@www.grupoburke.com > Message-ID: <5.2.0.9.0.20030126090422.02d52a90@66.28.54.253> --=======6C2A3E5======= Content-Type: text/plain; x-avg-checked=avg-ok-3F2D10D2; charset=us-ascii; format=flowed Content-Transfer-Encoding: 8bit At 05:35 AM 1/26/2003 +0100, Magnus Lycka wrote: > >>> import dbi, time > >>> help(dbi) FUNCTIONS dbDate(...) dbRaw(...) dbiDate(...) dbiRaw(...) DATA DATE = 'DATE' NUMBER = 'NUMBER' RAW = 'RAW' ROWID = 'ROWID' STRING = 'STRING' TYPES = ('STRING', 'RAW', 'NUMBER', 'DATE', 'ROWID') __file__ = r'P:\Python22\Lib\site-packages\win32\dbi.dll' __name__ = 'dbi' dataError = 'dbi.data-error' integrityError = 'dbi.integrity-error' internalError = 'dbi.internal-error' noError = 'dbi.no-error' opError = 'dbi.operation-error' progError = 'dbi.program-error' Thanks, but that does not really answer my questions. Bob Gailer mailto:ramrom@earthling.net 303 442 2625 --=======6C2A3E5======= Content-Type: text/plain; charset=us-ascii; x-avg=cert; x-avg-checked=avg-ok-3F2D10D2 Content-Disposition: inline --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.445 / Virus Database: 250 - Release Date: 1/21/2003 --=======6C2A3E5=======-- From magnus@thinkware.se Sun Jan 26 19:02:50 2003 From: magnus@thinkware.se (Magnus Lycka) Date: Sun, 26 Jan 2003 20:02:50 +0100 Subject: [DB-SIG] ODBC dbiDate and Date() problems In-Reply-To: <5.2.0.9.0.20030126090422.02d52a90@66.28.54.253> References: <5.1.0.14.0.20030126052100.02c0d6a8@www.thinkware.se> <5.2.0.9.0.20030124184915.01a07240@66.28.54.253> <44691.195.53.212.39.1029501945.squirrel@www.grupoburke.com > Message-ID: <5.1.0.14.0.20030126192511.02c05e20@www.thinkware.se> Bob Gailer wrote: >I have searched the documentation; there's no reference to odbc in >the library index or the module index The odbc and dbi modules are not a part of the Python standard library. They're a donation from EShop (which was bought by Micro$oft) and bundled with win32all. As far as I understand, they aren't maintained, and havn't been for years. ... >Thanks, but that does not really answer my questions. I don't know if there is more to know than in the info I gave and in the links that I included. I'm not sure there is more available than to convert to and from the old standard time module float format and the str formatting. >>> import dbi, time >>> now = time.time() >>> print now 1043606367.13 >>> print time.localtime(now) (2003, 1, 26, 19, 39, 27, 6, 26, 0) >>> d = dbi.dbiDate(now) >>> print str(d) Sun Jan 26 19:39:27 2003 >>> float(d) 1043606367.1339999 >>> time.localtime(d) (2003, 1, 26, 19, 39, 27, 6, 26, 0) I don't know how it will handle time zone info etc, but I guess this depends on database specific settings, as it does for ordinary Oracle interactive SQL sessions etc. The source is here: http://www.pythonpros.com/cgi-bin/cvsweb.cgi/PyWin32/win32/src/ -- Magnus Lycka, Thinkware AB Alvans vag 99, SE-907 50 UMEA, SWEDEN phone: int+46 70 582 80 65, fax: int+46 70 612 80 65 http://www.thinkware.se/ mailto:magnus@thinkware.se From ianb@colorstudy.com Tue Jan 28 09:05:54 2003 From: ianb@colorstudy.com (Ian Bicking) Date: 28 Jan 2003 03:05:54 -0600 Subject: [DB-SIG] ANN: SQLObject 0.2 Message-ID: <1043744754.29626.132.camel@lothlorien> SQLObject is an object-relational mapper (i.e., a database/SQL wrapper) that supports MySQL and PostgreSQL. Version 0.2 is the first public release. The software can be found at: http://colorstudy.com/software/SQLObject Features: - Takes advantage of new-style classes (both properties and metaclasses). Hi-Fi Python! (Python 2.2 required) - No external formats or configuration (e.g. XML); your tables are described with the class definition. - Accessing a column appears the same as accessing any other attribute. - Accompanying SQLBuilder allows WHERE clauses to be coded (somewhat) naturally in Python without SQL. - Caching (or no caching, no pressure). - Fully documented (interface documentation plus source comments). - Simple (naive?) transaction support for PostgreSQL. - Conforms to traditional schema; should be adapter to legacy schemas. - Understands basic relations. - The string "get" does not appear in any method. - 100% larger version number than previous version. License: LGPL Author: Me -- Ian Bicking Colorstudy Web Development ianb@colorstudy.com http://www.colorstudy.com PGP: gpg --keyserver pgp.mit.edu --recv-keys 0x9B9E28B7 4869 N Talman Ave, Chicago, IL 60625 / (773) 275-7241 From ernesto.molina@externo.mju.es Tue Jan 28 09:28:22 2003 From: ernesto.molina@externo.mju.es (Molina Carron) Date: Tue, 28 Jan 2003 10:28:22 +0100 Subject: [DB-SIG] problems with DCOracle2 running on solaris 8 (oracle 8.1.6) Message-ID: <000c01c2c6af$9a728c90$fb7a0c0a@burke> This is a multi-part message in MIME format. ------=_NextPart_000_0009_01C2C6B7.FC031350 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, don't know if this is the best mailing list for my question so, if = not, i beg your pardon Here it goes, anyway: i've DCOracle2 compiled from it's code for a = solaris 8, oracle 8.1.6, and after having done some work, i've noticed = that, somehow, sometimes it fails and brings a None where it should = bring data. Any idea? ------=_NextPart_000_0009_01C2C6B7.FC031350 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi, don't know if this is the best = mailing list for=20 my question so, if not, i beg your pardon
Here it goes, anyway: i've DCOracle2 = compiled from=20 it's code for a solaris 8, oracle 8.1.6, and after having done some = work, i've=20 noticed that, somehow, sometimes it fails and brings a None = where it=20 should bring data. Any idea?
------=_NextPart_000_0009_01C2C6B7.FC031350-- From andy47@halfcooked.com Tue Jan 28 10:29:52 2003 From: andy47@halfcooked.com (Andy Todd) Date: Tue, 28 Jan 2003 10:29:52 +0000 Subject: [DB-SIG] problems with DCOracle2 running on solaris 8 (oracle 8.1.6) In-Reply-To: <000c01c2c6af$9a728c90$fb7a0c0a@burke> References: <000c01c2c6af$9a728c90$fb7a0c0a@burke> Message-ID: <20030128102951.GA1556@LATITUDE6> On Tue, Jan 28, 2003 at 10:28:22AM +0100, Molina Carron wrote: > Hi, don't know if this is the best mailing list for my question so, if not, i beg your pardon > Here it goes, anyway: i've DCOracle2 compiled from it's code for a solaris 8, oracle 8.1.6, and after having done some work, i've noticed that, somehow, sometimes it fails and brings a None where it should bring data. Any idea? This is probably the place to ask, but you haven't yet given us enough information to help you out. Do you run the same queries in SQL*Plus and get rows returned? Do you get data returned from some queries and not others? What are the exact Python statements that cause you problems and what, if any, error messages do they return? Regards, Andy -- -------------------------------------------------------------------------------- >From the desk of Andrew J Todd esq http://www.halfcooked.com/ From ernesto.molina@externo.mju.es Tue Jan 28 11:15:58 2003 From: ernesto.molina@externo.mju.es (Molina Carron) Date: Tue, 28 Jan 2003 12:15:58 +0100 Subject: [DB-SIG] problems with DCOracle2 running on solaris 8 (oracle 8.1.6) Message-ID: <002001c2c6be$a22ae040$fb7a0c0a@burke> Right, this should help. My data (just a row): CD_CAMINO 2 CD_TRAMITE Registro CD_OPERACION 13800 CONDICION ANIO_EXP_FISCALIA & '' # '' CD_ACCION X>X PARAMETRO1 ANIO_EXP_FISCALIA PARAMETRO2 x PARAMETRO3 PARAMETRO4 ---------------------------------------------------------------------------- ---------------------------- My problem: *I get different values for the field Parametro2 depending on how i access to it: if my query is: select * from rm_tra_acciones where cd_tramite=:p1 and cd_camino=:p2, (2, 'Registro',) it returns a lot of rows, and, when i move to the one above, and ask for my field Parametro2 it returns None (wrong!) *On the other hand, if my query is: select * from rm_tra_acciones where cd_tramite=:p1 and cd_camino=:p2 and cd_operacion=:p3, (2, 'Registro',13800,) and ask my field, it returns x (correct!) *sqlplus works fine *No error messagges are returned *I get data from every query, but not every data is good ---------------------------------------------------------------------------- ---------------------- My python code: def test(): sql=[''' select * from rm_tra_acciones where cd_tramite=:p1 and cd_camino=:p2 ''', ''' select * from rm_tra_acciones where cd_tramite=:p1 and cd_camino=:p2 and cd_operacion=:p3 '''] params=[('Registro', 2,),('Registro', 2,13800,)] import DCOracle2 cadenaConn='%s/%s@%s'% ('menores','menores','datos10k') conn=DCOracle2.connect(cadenaConn) print 'test1' cur=conn.cursor() cur.execute(sql[0],params[0]) rs = cur.fetchall() print rs[41] ##the row print 'test2' cur=conn.cursor() cur.execute(sql[1],params[1]) print cur.fetchall()[0] ---------------------------------------------------------------------------- -------------------------------- The results: >python -u etcPythonOracle.py test1 [2L, 'Registro', 13800L, "ANIO_EXP_FISCALIA & '' # ''", 'X>X', 'ANIO_EXP_FISCALIA', None, None, None] test2 [2L, 'Registro', 13800L, "ANIO_EXP_FISCALIA & '' # ''", 'X>X', 'ANIO_EXP_FISCALIA', 'x', None, None] >Exit code: 0 Thanks From andy47@halfcooked.com Tue Jan 28 11:52:33 2003 From: andy47@halfcooked.com (Andy Todd) Date: Tue, 28 Jan 2003 11:52:33 +0000 Subject: [DB-SIG] problems with DCOracle2 running on solaris 8 (oracle 8.1.6) In-Reply-To: <002001c2c6be$a22ae040$fb7a0c0a@burke> References: <002001c2c6be$a22ae040$fb7a0c0a@burke> Message-ID: <20030128115233.GA2060@LATITUDE6> On Tue, Jan 28, 2003 at 12:15:58PM +0100, Molina Carron wrote: > Right, this should help. > > My data (just a row): > CD_CAMINO 2 > CD_TRAMITE Registro > CD_OPERACION 13800 > CONDICION ANIO_EXP_FISCALIA & '' # '' > CD_ACCION X>X > PARAMETRO1 ANIO_EXP_FISCALIA > PARAMETRO2 x > PARAMETRO3 > PARAMETRO4 > ---------------------------------------------------------------------------- > ---------------------------- > My problem: > *I get different values for the field Parametro2 depending on how i access > to it: if my query is: > select * from rm_tra_acciones where cd_tramite=:p1 and cd_camino=:p2, > (2, 'Registro',) > it returns a lot of rows, and, when i move to the one above, and ask for my > field Parametro2 it returns None (wrong!) > > *On the other hand, if my query is: > select * from rm_tra_acciones where cd_tramite=:p1 and cd_camino=:p2 and > cd_operacion=:p3, > (2, 'Registro',13800,) > and ask my field, it returns x (correct!) > > *sqlplus works fine > > *No error messagges are returned > > *I get data from every query, but not every data is good > ---------------------------------------------------------------------------- > ---------------------- > > My python code: > def test(): > sql=[''' select * from rm_tra_acciones > where cd_tramite=:p1 and cd_camino=:p2 > ''', > ''' select * from rm_tra_acciones > where cd_tramite=:p1 and cd_camino=:p2 and cd_operacion=:p3 > '''] > params=[('Registro', 2,),('Registro', 2,13800,)] > > import DCOracle2 > cadenaConn='%s/%s@%s'% ('menores','menores','datos10k') > conn=DCOracle2.connect(cadenaConn) > > print 'test1' > cur=conn.cursor() > cur.execute(sql[0],params[0]) > > rs = cur.fetchall() > > print rs[41] ##the row > > print 'test2' > cur=conn.cursor() > cur.execute(sql[1],params[1]) > print cur.fetchall()[0] > ---------------------------------------------------------------------------- > -------------------------------- > The results: > >python -u etcPythonOracle.py > test1 > [2L, 'Registro', 13800L, "ANIO_EXP_FISCALIA & '' # ''", 'X>X', > 'ANIO_EXP_FISCALIA', None, None, None] > test2 > [2L, 'Registro', 13800L, "ANIO_EXP_FISCALIA & '' # ''", 'X>X', > 'ANIO_EXP_FISCALIA', 'x', None, None] > >Exit code: 0 > > > Thanks > > My first impression is that this is a data issue and nothing to do with the db module or database. Are you sure that both of your queries are returning the same row? It looks like they are not. In test1 you are only restricting by cd_tramite and cd_camino but in test2 you add the cd_operacion column to the where clause. What happens if you include the ROWID pseudo column in your results sets, are they the same? The only other thing I can think of, and it is a long shot, is that you are not comparing the same columns. Whilst performing a 'SELECT *' is more than likely going to return the same columns in the same order each time you execute a query there is absolutely no guarantee that this is true. I would change your select clauses to ONLY return the columns of interest in this particular case and eliminate this possibility even though it is fairly unlikely to be the cause of your distress. Regards, Andy -- -------------------------------------------------------------------------------- >From the desk of Andrew J Todd esq http://www.halfcooked.com/ From ernesto.molina@externo.mju.es Tue Jan 28 16:15:07 2003 From: ernesto.molina@externo.mju.es (Molina Carron) Date: Tue, 28 Jan 2003 17:15:07 +0100 Subject: [DB-SIG] problems with DCOracle2 running on solaris 8 (oracle8.1.6) Message-ID: <000f01c2c6e8$6c5dbcb0$fb7a0c0a@burke> def testTRA_Acciones1(): sql=[''' select cd_camino,cd_tramite,cd_operacion,condicion,cd_accion, parametro1, parametro2, parametro3, parametro3 from rm_tra_acciones x where cd_tramite=:p1 and cd_camino=:p2 ''', ''' select cd_camino,cd_tramite,cd_operacion,condicion,cd_accion, parametro1, parametro2, parametro3, parametro3 from rm_tra_acciones x where cd_tramite=:p1 and cd_camino =:p2 and cd_operacion=:p3 '''] params=[('Registro', 2,),('Registro', 2,13800,)] import DCOracle2 cadenaConn='%s/%s@%s'% ('menores','menores','datos10k') conn=DCOracle2.connect(cadenaConn) cur=conn.cursor() cur.execute(sql[0],params[0]) rs = cur.fetchall() print """Primary key columns are CD_Camino, CD_Tramite and CD_Operacion, so feels like if both rows where the same""" print 'test1','-'*100 print [x[0] for x in cur.describe()] print rs[41] print 'test2','-'*100 cur=conn.cursor() cur.execute(sql[1],params[1]) rs=cur.fetchall() print [x[0] for x in cur.describe()] print rs[0] def testTRA_Acciones2(): sql=['''select rowid, cd_camino,cd_tramite,cd_operacion,condicion,cd_accion, parametro1, parametro2, parametro3, parametro3 from rm_tra_acciones x where cd_tramite=:p1 and cd_camino=:p2 ''', '''select rowid, cd_camino,cd_tramite,cd_operacion,condicion,cd_accion, parametro1, parametro2, parametro3, parametro3 from rm_tra_acciones x where cd_tramite=:p1 and cd_camino=:p2 and cd_operacion=:p3 '''] params=[('Registro', 2,),('Registro', 2,13800,)] import DCOracle2 cadenaConn='%s/%s@%s'% ('menores','menores','datos10k') conn=DCOracle2.connect(cadenaConn) cur=conn.cursor() cur.execute(sql[0],params[0]) rs = cur.fetchall() print print 'Test rowid','-'*80 print rs[41] rowid1=rs[41][0] cur=conn.cursor() cur.execute(sql[1],params[1]) rs = cur.fetchall() print rs[0] rowid2=rs[0][0] print 'is it the same rowid?',rowid1 is rowid2 print def testTRA_Acciones3(): sql=['''select rowid, cd_camino,cd_tramite,cd_operacion,condicion,cd_accion, parametro1, parametro2, parametro3, parametro3 from rm_tra_acciones x where cd_tramite=:p1 and cd_camino=:p2 and cd_operacion=:p3 '''] params=[('Registro', 2,13800,)] import DCOracle2 cadenaConn='%s/%s@%s'% ('menores','menores','datos10k') conn=DCOracle2.connect(cadenaConn) cur=conn.cursor() cur.execute(sql[0],params[0]) rs = cur.fetchone() print 'Test 1=1: gonna fetch the same row, the same query twice','-'*30 print rs rowid1=rs[0] cur=conn.cursor() cur.execute(sql[0],params[0]) rs = cur.fetchone() print rs rowid2=rs[0] print 'is it the same rowid?',rowid1 is rowid2 print sqlRowID='''select rowid, cd_camino,cd_tramite,cd_operacion,condicion,cd_accion, parametro1, parametro2, parametro3, parametro3 from rm_tra_acciones x where rowid=:p1''' cur=conn.cursor() cur.execute(sqlRowID,rowid1) rs = cur.fetchone() print 'fetch the row looking for its rowid','-'*30 print rs cur=conn.cursor() cur.execute(sqlRowID,rowid2) rs = cur.fetchone() print 'fetch the row looking for its rowid (2)','-'*30 print rs if __name__=='__main__': testTRA_Acciones1() testTRA_Acciones2() testTRA_Acciones3() --------------------------------------------------------------- the results --------------------------------------------------------------- Primary key columns are CD_Camino, CD_Tramite and CD_Operacion, so feels like if both rows where the same test1 ---------------------------------------------------------------------- ------------------------------ ['CD_CAMINO', 'CD_TRAMITE', 'CD_OPERACION', 'CONDICION', 'CD_ACCION', 'PARAMETRO1', 'PARAMETRO2', 'PARAMETRO3', 'PARAMETRO3'] [2L, 'Registro', 13800L, "ANIO_EXP_FISCALIA & '' # ''", 'X>X', 'ANIO_EXP_FISCALIA', None, None, None] test2 ---------------------------------------------------------------------- ------------------------------ ['CD_CAMINO', 'CD_TRAMITE', 'CD_OPERACION', 'CONDICION', 'CD_ACCION', 'PARAMETRO1', 'PARAMETRO2', 'PARAMETRO3', 'PARAMETRO3'] [2L, 'Registro', 13800L, "ANIO_EXP_FISCALIA & '' # ''", 'X>X', 'ANIO_EXP_FISCALIA', 'x', None, None] Test rowid ---------------------------------------------------------------------- ---------- [, 2L, 'Registro', 13800L, "ANIO_EXP_FISCALIA & '' # ''", 'X>X', 'ANIO_EXP_FISCALIA', None, None, None] [, 2L, 'Registro', 13800L, "ANIO_EXP_FISCALIA & '' # ''", 'X>X', 'ANIO_EXP_FISCALIA', 'x', None, None] is it the same rowid? 0 Test 1=1: gonna fetch the same row, the same query twice ------------------------------ [, 2L, 'Registro', 13800L, "ANIO_EXP_FISCALIA & '' # ''", 'X>X', 'ANIO_EXP_FISCALIA', 'x', None, None] [, 2L, 'Registro', 13800L, "ANIO_EXP_FISCALIA & '' # ''", 'X>X', 'ANIO_EXP_FISCALIA', 'x', None, None] is it the same rowid? 0 fetch the row looking for its rowid ------------------------------ [, 2L, 'Registro', 13800L, "ANIO_EXP_FISCALIA & '' # ''", 'X>X', 'ANIO_EXP_FISCALIA', 'x', None, None] fetch the row looking for its rowid (2) ------------------------------ [, 2L, 'Registro', 13800L, "ANIO_EXP_FISCALIA & ' ' # ''", 'X>X', 'ANIO_EXP_FISCALIA', 'x', None, None] From matt@zope.com Tue Jan 28 17:59:22 2003 From: matt@zope.com (Matthew T. Kromer) Date: Tue, 28 Jan 2003 12:59:22 -0500 Subject: [DB-SIG] problems with DCOracle2 running on solaris 8 (oracle 8.1.6) In-Reply-To: <20030128115233.GA2060@LATITUDE6> References: <002001c2c6be$a22ae040$fb7a0c0a@burke> <20030128115233.GA2060@LATITUDE6> Message-ID: <3E36C4FA.70408@zope.com> I'm jumping into this thread a bit late but here goes. I've had reports from a few sources that large queries would occasionally return NULL values instead of the columns they should when used on Linux rather than Solaris. There may be a bizarre Oracle problem (which would be a first, wouldn't it?!) or a problem with the DCOracle2 code. The only way for me to determine that for sure is to take a look at the trace logs DCOracle2 can generate. You can either export DCO2TRACELOG=filename which turns on continuous logging to a file or export DCO2TRACEFLAGS=255 which enables tracing but doesn't record to a file -- you can then do DCOracle2.traceback(format=1) to format the trace buffer. The key thing I want to look at is whether or not there is a NULL answer being returned from the C layer, or if it's coming in from someplace else. Andy Todd wrote: >On Tue, Jan 28, 2003 at 12:15:58PM +0100, Molina Carron wrote: > > >>Right, this should help. >> >>My data (just a row): >>CD_CAMINO 2 >>CD_TRAMITE Registro >>CD_OPERACION 13800 >>CONDICION ANIO_EXP_FISCALIA & '' # '' >>CD_ACCION X>X >>PARAMETRO1 ANIO_EXP_FISCALIA >>PARAMETRO2 x >>PARAMETRO3 >>PARAMETRO4 >>---------------------------------------------------------------------------- >>---------------------------- >>My problem: >>*I get different values for the field Parametro2 depending on how i access >>to it: if my query is: >> select * from rm_tra_acciones where cd_tramite=:p1 and cd_camino=:p2, >>(2, 'Registro',) >>it returns a lot of rows, and, when i move to the one above, and ask for my >>field Parametro2 it returns None (wrong!) >> >>*On the other hand, if my query is: >>select * from rm_tra_acciones where cd_tramite=:p1 and cd_camino=:p2 and >>cd_operacion=:p3, >>(2, 'Registro',13800,) >>and ask my field, it returns x (correct!) >> >>*sqlplus works fine >> >>*No error messagges are returned >> >>*I get data from every query, but not every data is good >>---------------------------------------------------------------------------- >>---------------------- >> >>My python code: >>def test(): >> sql=[''' select * from rm_tra_acciones >> where cd_tramite=:p1 and cd_camino=:p2 >> ''', >> ''' select * from rm_tra_acciones >> where cd_tramite=:p1 and cd_camino=:p2 and cd_operacion=:p3 >> '''] >> params=[('Registro', 2,),('Registro', 2,13800,)] >> >> import DCOracle2 >> cadenaConn='%s/%s@%s'% ('menores','menores','datos10k') >> conn=DCOracle2.connect(cadenaConn) >> >> print 'test1' >> cur=conn.cursor() >> cur.execute(sql[0],params[0]) >> >> rs = cur.fetchall() >> >> print rs[41] ##the row >> >> print 'test2' >> cur=conn.cursor() >> cur.execute(sql[1],params[1]) >> print cur.fetchall()[0] >>---------------------------------------------------------------------------- >>-------------------------------- >>The results: >> >> >>>python -u etcPythonOracle.py >>> >>> >>test1 >>[2L, 'Registro', 13800L, "ANIO_EXP_FISCALIA & '' # ''", 'X>X', >>'ANIO_EXP_FISCALIA', None, None, None] >>test2 >>[2L, 'Registro', 13800L, "ANIO_EXP_FISCALIA & '' # ''", 'X>X', >>'ANIO_EXP_FISCALIA', 'x', None, None] >> >> >>>Exit code: 0 >>> >>> >>Thanks >> >> >> >> > >My first impression is that this is a data issue and nothing to do with the db module or database. Are you sure that both of your queries are returning the same row? It looks like they are not. > >In test1 you are only restricting by cd_tramite and cd_camino but in test2 you add the cd_operacion column to the where clause. What happens if you include the ROWID pseudo column in your results sets, are they the same? > >The only other thing I can think of, and it is a long shot, is that you are not comparing the same columns. Whilst performing a 'SELECT *' is more than likely going to return the same columns in the same order each time you execute a query there is absolutely no guarantee that this is true. I would change your select clauses to ONLY return the columns of interest in this particular case and eliminate this possibility even though it is fairly unlikely to be the cause of your distress. > >Regards, >Andy > > From ovidiu@recognos.ro Wed Jan 29 07:26:20 2003 From: ovidiu@recognos.ro (Ovidiu) Date: Wed, 29 Jan 2003 09:26:20 +0200 Subject: [DB-SIG] MSSQL Python module Message-ID: <003601c2c767$b884b920$7750a8c0@RECOGNOS.RO> This is a multi-part message in MIME format. ------=_NextPart_000_0033_01C2C778.7BFB39A0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, I have a question, and maybe some of you guys can help me. I'm = currently testing MSSQL Server Module for Python from Object Craft ( = http://www.object-craft.com.au/projects/mssql/ ), in order to use it = instead of ADO, and my problem is around executing stored procedures = with input/output parameters. They admit having an issue on = cursor.callproc, recommanding instead cursor.execute. Now, If my stored procedure has no parameters, then both methods = works perfect. If there are some parameters ( input parameters ), = cursor.callproc fails saying 'Internal error: dbrpcparam' but = cursor.execute works excellent. The real problem is that I don't know how to access the output = parameters when execution returns. The documentation don't say anything = and neither the source code. Anyone of you had a similar problem? Thank you, Ovidiu Birladeanu ( ovidiu@recognos.ro ) Software developer Recognos Romania ------=_NextPart_000_0033_01C2C778.7BFB39A0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi,
 
        I have a=20 question, and maybe some of you guys can help me. I'm currently testing = MSSQL=20 Server Module for Python from Object Craft ( http://www.object= -craft.com.au/projects/mssql/ ),=20 in order to use it instead of ADO, and my problem is around executing = stored=20 procedures with input/output parameters. They admit having an issue on=20 cursor.callproc, recommanding instead cursor.execute.
 
   =20     Now, If my stored procedure has no parameters, then = both=20 methods works perfect. If there are some parameters ( input parameters = ),=20 cursor.callproc fails saying 'Internal error: dbrpcparam'  but=20 cursor.execute works excellent.
 
        The real=20 problem is that I don't know how to access the output parameters when = execution=20 returns. The documentation don't say anything and neither the source=20 code.
Anyone of you had a similar = problem?
 
Thank you,
Ovidiu Birladeanu ( ovidiu@recognos.ro )
Software=20 developer
Recognos Romania
------=_NextPart_000_0033_01C2C778.7BFB39A0-- From vecernik@aon.at Wed Jan 29 08:01:09 2003 From: vecernik@aon.at (Oliver Vecernik) Date: Wed, 29 Jan 2003 09:01:09 +0100 Subject: [DB-SIG] Re: MSSQL Python module References: <003601c2c767$b884b920$7750a8c0@RECOGNOS.RO> Message-ID: <3E378A45.1050204@aon.at> Ovidiu schrieb: > Hi, > > I have a question, and maybe some of you guys can help me. I'm > currently testing MSSQL Server Module for Python from Object Craft ( > http://www.object-craft.com.au/projects/mssql/ ), in order to use it > instead of ADO, and my problem is around executing stored procedures > with input/output parameters. They admit having an issue on > cursor.callproc, recommanding instead cursor.execute. > > Now, If my stored procedure has no parameters, then both methods > works perfect. If there are some parameters ( input parameters ), > cursor.callproc fails saying 'Internal error: dbrpcparam' but > cursor.execute works excellent. > > The real problem is that I don't know how to access the output > parameters when execution returns. The documentation don't say anything > and neither the source code. > Anyone of you had a similar problem? From their HP: ... The MS SQL Server package is still in early development so some things will not work - other things will GP fault. ... If you use the module please send me some email so I can either fix the problem or document the things that work. ... If you have any trouble shooting suggestions, please send me some email at djc@object-craft.com.au HTH Oliver From ernesto.molina@externo.mju.es Wed Jan 29 09:42:10 2003 From: ernesto.molina@externo.mju.es (Molina Carron) Date: Wed, 29 Jan 2003 10:42:10 +0100 Subject: [DB-SIG] problems with DCOracle2 running on solaris 8 (oracle 8.1.6) Message-ID: <005c01c2c77a$b1e3d070$fb7a0c0a@burke> I've tried to see the trace but it doesn't work Traceback (most recent call last): File "etcPythonOracle.py", line 434, in ? print DCOracle2.traceback(format=1) File "/usr/local/lib/python2.2/site-packages/DCOracle2/DCOracle2.py", line 176, in traceback t = dco2.Traceback() NotImplementedError: Trace table not available So, maybe its a matter of versions (mine is1.2 -- DCOracle2 1.95 (dco2: 1.120 -DCORACLE8i -DUSEOBJECT -D_REENTRANT)) Anyway, i think i should explain my previous mail: i sent a few tests and their results but no explanation: **the first part was the python code, 3 tests following the instructions of Andy ("select column1, column2..." instead of "select * ...", showing the order of the columns with cursor.describe(), and showing the rowid, mapped into a OracleRowID type). I also showed which columns formed the primary key, so that we were sure it was the same row. The third test is a bit confusing for me: i made the same query twice, compared both OracleRowID's and they weren't the same!! **The second part is the result of the python code From simuran@shaw.ca Thu Jan 30 04:16:19 2003 From: simuran@shaw.ca (Alex Rodioukov) Date: 29 Jan 2003 21:16:19 -0700 Subject: [DB-SIG] Errors building Sybase module. Message-ID: <1043900179.62448.19.camel@bismark.io.sys> --=-YYVW+KxgBw9H/VUM7BFy Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi All, I have a bit of problem compiling python Sybase module on Linux. Here's the relevant info: Red Hat 7.3 Python 2.1 (from source) freetds-current (21122002) sybase-0.35 and sybase-0.36pre3 freetds build: $ ./configure --with-tdsver=3D7.0 --prefix=3D/usr/local/freetds # make && make install sybase build (both 0.35 and 0.36pre3): $ export SYBASE=3D/usr/local/freetds=20 # python setup.py build_ext -D WANT_THREADS -D HAVE_FREETDS -U WANT_BULKCOPY running build_ext building 'sybasect' extension creating build creating build/temp.linux-i686-2.1 gcc -g -O2 -D_FILE_OFFSET_BITS=3D64 -DHAVE_LARGEFILE_SUPPORT -fPIC -DWANT_BULKCOPY -DHAVE_FREETDS=3D1 -UWANT_BULKCOPY -I/usr/local/freetds/include -I/usr/include/python2.1 -c blk.c -o build/temp.linux-i686-2.1/blk.o In file included from sybasect.h:18, from blk.c:9: freetds.h:68: redefinition of `CS_BIT' /usr/local/freetds/include/cspublic.h:57: `CS_BIT' previously declared here freetds.h:69: redefinition of `CS_USHORT' /usr/local/freetds/include/cspublic.h:56: `CS_USHORT' previously declared here freetds.h:70: redefinition of `CS_BINARY' /usr/local/freetds/include/cspublic.h:55: `CS_BINARY' previously declared here freetds.h:71: conflicting types for `CS_LONG' /usr/local/freetds/include/cspublic.h:54: previous declaration of `CS_LONG' freetds.h:72: redefinition of `CS_LONGCHAR' /usr/local/freetds/include/cspublic.h:53: `CS_LONGCHAR' previously declared here freetds.h:73: redefinition of `CS_LONGBINARY' /usr/local/freetds/include/cspublic.h:52: `CS_LONGBINARY' previously declared here freetds.h:74: redefinition of `CS_TEXT' /usr/local/freetds/include/cspublic.h:51: `CS_TEXT' previously declared here freetds.h:75: redefinition of `CS_IMAGE' /usr/local/freetds/include/cspublic.h:50: `CS_IMAGE' previously declared here freetds.h:76: redefinition of `CS_DECIMAL' /usr/local/freetds/include/cspublic.h:49: `CS_DECIMAL' previously declared here freetds.h:112: conflicting types for `ct_command' /usr/local/freetds/include/ctpublic.h:43: previous declaration of `ct_command' error: command 'gcc' failed with exit status 1 If anyone has any clues on why the build traps I'll appreciate your help. I have a feeling that freetds version might be a bit 'too current' :) and whoever compiled sybase successfully please let me know against which snapshot (date) the build was attempted so I might try to get that version from freetds's CVS. TIA, Alex. --=-YYVW+KxgBw9H/VUM7BFy Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQA+OKcTtcqPUfyOrDQRAjbpAKCbotjVogl6cG1JsYp77wH7l6V+ZgCg5lja C0tco5S7yHeNjHlmRIV8j6k= =sOpO -----END PGP SIGNATURE----- --=-YYVW+KxgBw9H/VUM7BFy-- From simuran@shaw.ca Thu Jan 30 17:45:36 2003 From: simuran@shaw.ca (Alex Rodioukov) Date: 30 Jan 2003 10:45:36 -0700 Subject: [DB-SIG] Errors building Sybase module. In-Reply-To: <1043900179.62448.19.camel@bismark.io.sys> References: <1043900179.62448.19.camel@bismark.io.sys> Message-ID: <1043948736.62448.25.camel@bismark.io.sys> --=-kyVF90QC2JlBiI+4qVhR Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Ok, I've managed to build the Sybase module with following patch: diff -ruN sybasect.h~ sybasect.h --- sybasect.h~ Thu Jan 30 10:26:16 2003 +++ sybasect.h Thu Jan 30 10:26:16 2003 @@ -14,7 +14,7 @@ #include "pythread.h" #include "structmember.h" -#ifdef HAVE_FREETDS +#ifndef HAVE_FREETDS #include "freetds.h" #endif But when I'm trying to create a connection object in Python I'm receiving following traceback: >>> import Sybase >>> con =3D Sybase.connect('SANDBOX', 'sa', 'xxx') Traceback (most recent call last): File "", line 1, in ? File "/usr/lib/python2.1/site-packages/Sybase.py", line 768, in connect strip, auto_commit, delay_connect, locking) File "/usr/lib/python2.1/site-packages/Sybase.py", line 608, in __init__ self.connect() File "/usr/lib/python2.1/site-packages/Sybase.py", line 633, in connect self._raise_error(Error, 'ct_options') File "/usr/lib/python2.1/site-packages/Sybase.py", line 621, in _raise_er= ror raise exc(text) Sybase.Error: ct_options Any ideas? Regards, Alex. --=-kyVF90QC2JlBiI+4qVhR Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQA+OWTAtcqPUfyOrDQRAiPMAKDhYXbjJlJrJD9KF7dSmBYlPJHkJgCZAfsh NKNI5HGm0/TJseHHMuQUsMc= =SRdn -----END PGP SIGNATURE----- --=-kyVF90QC2JlBiI+4qVhR-- From djc@object-craft.com.au Fri Jan 31 01:49:36 2003 From: djc@object-craft.com.au (Dave Cole) Date: 31 Jan 2003 12:49:36 +1100 Subject: [DB-SIG] Errors building Sybase module. In-Reply-To: <1043948736.62448.25.camel@bismark.io.sys> References: <1043900179.62448.19.camel@bismark.io.sys> <1043948736.62448.25.camel@bismark.io.sys> Message-ID: alex> Ok, I've managed to build the Sybase module with following patch: alex> diff -ruN sybasect.h~ sybasect.h alex> --- sybasect.h~ Thu Jan 30 10:26:16 2003 alex> +++ sybasect.h Thu Jan 30 10:26:16 2003 alex> @@ -14,7 +14,7 @@ alex> #include "pythread.h" alex> #include "structmember.h" alex> alex> -#ifdef HAVE_FREETDS alex> +#ifndef HAVE_FREETDS alex> #include "freetds.h" alex> #endif That might get the module to compile but it a broken fix. If you were seeing errors in "freetds.h" then you need fix those, not prevent the file from being included. alex> But when I'm trying to create a connection object in Python I'm alex> receiving following traceback: alex> alex> >>> import Sybase alex> >>> con = Sybase.connect('SANDBOX', 'sa', 'xxx') alex> Traceback (most recent call last): alex> File "", line 1, in ? alex> File "/usr/lib/python2.1/site-packages/Sybase.py", line 768, in connect alex> strip, auto_commit, delay_connect, locking) alex> File "/usr/lib/python2.1/site-packages/Sybase.py", line 608, in __init__ alex> self.connect() alex> File "/usr/lib/python2.1/site-packages/Sybase.py", line 633, in connect alex> self._raise_error(Error, 'ct_options') alex> File "/usr/lib/python2.1/site-packages/Sybase.py", line 621, in _raise_error alex> raise exc(text) alex> Sybase.Error: ct_options alex> alex> Any ideas? The best approach to understanding what is going wrong in the module is to do the following: >>> import Sybase >>> Sybase._ctx.debug = 1 >>> con = Sybase.connect('SANDBOX', 'sa', 'xxx') - Dave -- http://www.object-craft.com.au From vishnu_mahendra@yahoo.com Fri Jan 31 05:50:25 2003 From: vishnu_mahendra@yahoo.com (vishnu mahendra) Date: Thu, 30 Jan 2003 21:50:25 -0800 (PST) Subject: [DB-SIG] interfacing python,mysql Message-ID: <20030131055025.65877.qmail@web40809.mail.yahoo.com> is there any simple ways to connect mysql with python in windows and linux __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com From ianb@colorstudy.com Fri Jan 31 07:34:20 2003 From: ianb@colorstudy.com (Ian Bicking) Date: 31 Jan 2003 01:34:20 -0600 Subject: [DB-SIG] interfacing python,mysql In-Reply-To: <20030131055025.65877.qmail@web40809.mail.yahoo.com> References: <20030131055025.65877.qmail@web40809.mail.yahoo.com> Message-ID: <1043998460.11025.51.camel@lothlorien> Yes: http://sourceforge.net/projects/mysql-python On Thu, 2003-01-30 at 23:50, vishnu mahendra wrote: > is there any simple ways to connect mysql with python > in windows and linux > > __________________________________________________ > Do you Yahoo!? > Yahoo! Mail Plus - Powerful. Affordable. Sign up now. > http://mailplus.yahoo.com > > _______________________________________________ > DB-SIG maillist - DB-SIG@python.org > http://mail.python.org/mailman/listinfo/db-sig -- Ian Bicking From zohr@eth.net Fri Jan 31 10:23:37 2003 From: zohr@eth.net (zohar) Date: Fri, 31 Jan 2003 15:53:37 +0530 Subject: [DB-SIG] RDBMS Message-ID: <000101c2c94a$bb062460$108b09ca@zohar> Respected Sir, I am(ZOHAR BATTERYWALA) a student in BCA in IGNOU in VADODARA, GUJARAT, INDIA. I am designing a SCM(Supply chain management) application and it consists of more than 160 tables. For this I have chosen MySQL instead of ORACLE for the following reasons: (1) Basic version is free and even registration fees for commercial version is not too much. (2) Is ranked to be equal in performance(4.0 version) to oracle. (3) Has a userbase that is connected by mailing list so you cannot expect support as of Oracle but you can get a solution. (4) Mostly anticipating the high fee of Oracle, the industries to whom I want to sell might not take it. According to you, if I am wrong, where am I wrong?? Please give your valuable suggestions. I am looking for a utility that makes the task of making ERD and flow chart design somewhat faster than the manual attempt. Can you suggest me something. Also please show me where I could find a Python-DB tutorial Also where I could get MySQL DB-API Driver/tutorial/or any related thing/and IDE or RAD tool, (even for designing), most suited for making database application in python as by conventional way if I go making 160+ forms, 250+ reports and graphs would take about 4-5 months. Zohar From mal@lemburg.com Fri Jan 31 17:16:32 2003 From: mal@lemburg.com (M.-A. Lemburg) Date: Fri, 31 Jan 2003 18:16:32 +0100 Subject: [DB-SIG] RDBMS In-Reply-To: <000101c2c94a$bb062460$108b09ca@zohar> References: <000101c2c94a$bb062460$108b09ca@zohar> Message-ID: <3E3AAF70.7050707@lemburg.com> zohar wrote: > Respected Sir, > > I am(ZOHAR BATTERYWALA) a student in BCA in IGNOU in VADODARA, GUJARAT, > INDIA. > > I am designing a SCM(Supply chain management) application and it consists of > more than 160 tables. > > For this I have chosen MySQL instead of ORACLE for the following reasons: > (1) Basic version is free and even registration fees for commercial version > is not too much. > (2) Is ranked to be equal in performance(4.0 version) to oracle. > (3) Has a userbase that is connected by mailing list so you cannot expect > support as of Oracle but you can get a solution. > (4) Mostly anticipating the high fee of Oracle, the industries to whom I > want to sell might not take it. > > According to you, if I am wrong, where am I wrong?? Please give your > valuable suggestions. I'd suggest you take a look at PostreSQL and SAP DB instead. They both offer more features and have proven to be robust. > I am looking for a utility that makes the task of making ERD and flow chart > design somewhat faster than the manual attempt. Can you suggest me > something. > > Also please show me where I could find a Python-DB tutorial The best tutorials can probably be found in recent Python books. See python.org for details. You also want to check the Python Database Topic Guide on python.org. > Also where I could get MySQL DB-API Driver/tutorial/or any related > thing/and IDE or RAD tool, (even for designing), most suited for making > database application in python as by conventional way if I go making > 160+ forms, 250+ reports and graphs would take about 4-5 months. You should try one of the many Python IDEs. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From magnus@thinkware.se Fri Jan 31 23:58:53 2003 From: magnus@thinkware.se (Magnus Lycka) Date: Sat, 01 Feb 2003 00:58:53 +0100 Subject: [DB-SIG] RDBMS In-Reply-To: <000101c2c94a$bb062460$108b09ca@zohar> Message-ID: <5.1.0.14.0.20030201002642.02ac0bf8@www.thinkware.se> At 15:53 2003-01-31 +0530, zohar wrote: >For this I have chosen MySQL instead of ORACLE for the following reasons: >(1) Basic version is free and even registration fees for commercial version >is not too much. Sure. >(2) Is ranked to be equal in performance(4.0 version) to oracle. Benchmarks have a limited value. I've had Ingres databases change performance drastially between versions, and Informix databases too. It depends a lot of details in use. It's very difficult to make general statements about performance. Your case might be very different from the benchmarks you look at. >(3) Has a userbase that is connected by mailing list so you cannot expect >support as of Oracle but you can get a solution. Well... Hopefully... But perhaps not always a perfect fit. See below. >(4) Mostly anticipating the high fee of Oracle, the industries to whom I >want to sell might not take it. There are a lot of options, commercial as well as free, and I think most are cheaper than Oracle. A large client of mine with tens of thousands of users threw out Oracle in favour for IBM DB2 since it led to a 90% lower price... I guess there s less competition than it used to be... What is your intended platform? I think you should follow Marc-André's advice and look at PostgreSQL and SAP DB as well. Being Swedish I'm obviously happy if people use MySQL, but it's not the ideal solution for everything. Both transaction support and sub queries are features that most databases have had for years. These features are still recent additions to MySQL. The strong side for MySQL is for databases where the amount of SELECTS outnumber the amount of INSERT or UPDATEs by far. It's not ideal for on-line transaction processing, more for data catalogs, such as dynamic web sites that store web pages and search indices in the database. Talking of Swedish databases, Mimer is another option. I'm not sure about native drivers though, but ODBC will work. >I am looking for a utility that makes the task of making ERD and flow chart >design somewhat faster than the manual attempt. Can you suggest me >something. No idea... It sounds you are into data modelling and structured design. An object oriented approach will probably use the strengths of Python better. >Also please show me where I could find a Python-DB tutorial If you do use MySQLdb, there are some examples in the docs. Steve Holden's Python Web Programming discusses this subject in some depth, and there is another book on the same subject that has more of a Linux/Apache/MySQL approach. >Also where I could get MySQL DB-API Driver/tutorial/or any related >thing/and IDE or RAD tool, (even for designing), most suited for making >database application in python as by conventional way if I go making >160+ forms, 250+ reports and graphs would take about 4-5 months. I don't think there is anything remotely like MS Access or Panther (www.possl.org) for Python and SQL databases. I think the typical approach among Python programmers is to use inheritence cleverly. To try to write as little unique code for each form and report as possible. That can lead to both a lower workload and a more uniform application, which might be comparable to a more automated approach. In comparision to a more automated approach, it might well lead to a lower long term maintenance cost. That is, if it's done right... What do you plan to use for user interface and for reports? Python GUI tools are all geared to a certain toolkit (I think). wxDesigner is fairly popular for building wxPython GUIs, and Boa Constructor is maturing in the role of a free alternative. If you want to make pretty reports, have a look at the PDF generation package ReportLab, www.reportlab.com. You might also be interested in Gnu Enterprise, http://www.gnuenterprise.org/, but I'm not sure how mature that is... -- Magnus Lycka, Thinkware AB Alvans vag 99, SE-907 50 UMEA, SWEDEN phone: int+46 70 582 80 65, fax: int+46 70 612 80 65 http://www.thinkware.se/ mailto:magnus@thinkware.se