From missive at hotmail.com Mon Apr 5 16:56:19 2004 From: missive at hotmail.com (Lee Harr) Date: Mon Apr 5 16:56:23 2004 Subject: [DB-SIG] db paramstyle for arrays Message-ID: Is there a special DB API style for inserting array values in to a database? In postgres, the values needs to end up like ARRAY[1, 2, 3] so I am just putting the word ARRAY in to the query string like this: q = "INSERT INTO foo VALUES (ARRAY%(bar)s)" % {'bar': [1, 2, 3]} That works, but it seems to me there may be a better way. Thanks for your time. _________________________________________________________________ Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail From ods at strana.ru Tue Apr 6 07:22:56 2004 From: ods at strana.ru (Denis S. Otkidach) Date: Tue Apr 6 07:26:51 2004 Subject: [DB-SIG] db paramstyle for arrays In-Reply-To: Message-ID: On Mon, 5 Apr 2004, Lee Harr wrote: LH> Is there a special DB API style for inserting array values LH> in LH> to a database? What DB API module do you use? For pyPgSQL the answer is in FAQ (http://pypgsql.sourceforge.net/pypgsql-faq.html): If you want to use ARRAYs, you'll now need to wrap your (nested) lists with PgSQL.PgArray -- Denis S. Otkidach http://www.python.ru/ [ru] From missive at hotmail.com Tue Apr 6 16:25:38 2004 From: missive at hotmail.com (Lee Harr) Date: Tue Apr 6 16:25:50 2004 Subject: [DB-SIG] db paramstyle for arrays Message-ID: >LH> Is there a special DB API style for inserting array values >LH> in >LH> to a database? > >What DB API module do you use? For pyPgSQL the answer is in FAQ >(http://pypgsql.sourceforge.net/pypgsql-faq.html): >If you want to use ARRAYs, you'll now need to wrap your (nested) >lists with PgSQL.PgArray > I am using psycopg. grep'ng through the psycopg distribution does not reveal mention of ARRAY, so I guess it does not support that. Is there anything about it in the DB API? I looked through pep 249 but I do not see anything. I could create a patch for psycopg to do something like the way pyPgSQL does it, but it would be good if they were all the same... Is there a list somewhere of the various % placeholders? Or are they just the regular string ones used for database operations? What I was thinking was maybe there could be a %a (or something else if that is already taken) which could automatically format the input as an array. Is work still being done on DB-API? This list is very quiet.... _________________________________________________________________ MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. http://join.msn.com/?page=features/virus From fog at initd.org Tue Apr 6 17:14:02 2004 From: fog at initd.org (Federico Di Gregorio) Date: Tue Apr 6 17:16:08 2004 Subject: [DB-SIG] db paramstyle for arrays In-Reply-To: References: Message-ID: <1081286042.2358.1.camel@localhost> Il mar, 2004-04-06 alle 22:25, Lee Harr ha scritto: > >LH> Is there a special DB API style for inserting array values > >LH> in > >LH> to a database? > > > >What DB API module do you use? For pyPgSQL the answer is in FAQ > >(http://pypgsql.sourceforge.net/pypgsql-faq.html): > >If you want to use ARRAYs, you'll now need to wrap your (nested) > >lists with PgSQL.PgArray > > > > I am using psycopg. > > grep'ng through the psycopg distribution does not reveal > mention of ARRAY, so I guess it does not support that. ouch, right. > Is there anything about it in the DB API? I looked through pep 249 > but I do not see anything. I could create a patch > for psycopg to do something like the way pyPgSQL does it, but > it would be good if they were all the same... if you want to patch, please try psycopg 2 alpha that has a nice support for custom python->postgresql type conversions. -- Federico Di Gregorio http://people.initd.org/fog Debian GNU/Linux Developer fog@debian.org INIT.D Developer fog@initd.org Best friends are often failed lovers. -- Me -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Questa parte del messaggio =?ISO-8859-1?Q?=E8?= firmata Url : http://mail.python.org/pipermail/db-sig/attachments/20040406/704f35b3/attachment.bin From mal at egenix.com Wed Apr 7 05:11:31 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Apr 7 05:11:42 2004 Subject: [DB-SIG] db paramstyle for arrays In-Reply-To: References: Message-ID: <4073C5C3.6020604@egenix.com> Lee Harr wrote: >> LH> Is there a special DB API style for inserting array values >> LH> in >> LH> to a database? >> >> What DB API module do you use? For pyPgSQL the answer is in FAQ >> (http://pypgsql.sourceforge.net/pypgsql-faq.html): >> If you want to use ARRAYs, you'll now need to wrap your (nested) >> lists with PgSQL.PgArray >> > > I am using psycopg. > > grep'ng through the psycopg distribution does not reveal > mention of ARRAY, so I guess it does not support that. > > Is there anything about it in the DB API? I looked through pep 249 > but I do not see anything. I could create a patch > for psycopg to do something like the way pyPgSQL does it, but > it would be good if they were all the same... The DB API supports doing bulk inserts via .executemany(), but I'm not sure whether the same thing as inserting ARRAYs which seem to be a postgresql special data type from your description. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Apr 07 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ Python UK 2004, Oxford, UK 8 days left EuroPython 2004, G?teborg, Sweden 60 days left ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From antivirus at antidegroup.com Wed Apr 7 08:23:43 2004 From: antivirus at antidegroup.com (Antide MailScanner) Date: Wed Apr 7 08:23:52 2004 Subject: [DB-SIG] Warning: E-mail viruses detected Message-ID: <200404071223.i37CNhe07893@rq8.x-land.net> Our virus detector has just been triggered by a message you sent:- To: Subject: Re: Your software Date: Wed Apr 7 14:23:21 2004 One or more of the attachments are on the list of unacceptable attachments for this site and will not have been delivered. Consider renaming the files or putting them into a "zip" file to avoid this constraint. The virus detector said this about the message: Report: Shortcuts to MS-Dos programs are very dangerous in email (application.pif) -- Antide MailScanner Email Virus Scanner www.antidehost.com From ods at strana.ru Wed Apr 7 09:03:13 2004 From: ods at strana.ru (Denis S. Otkidach) Date: Wed Apr 7 09:07:12 2004 Subject: [DB-SIG] db paramstyle for arrays In-Reply-To: Message-ID: On Tue, 6 Apr 2004, Lee Harr wrote: LH> grep'ng through the psycopg distribution does not reveal LH> mention of ARRAY, so I guess it does not support that. LH> LH> Is there anything about it in the DB API? I looked through LH> pep 249 LH> but I do not see anything. I could create a patch LH> for psycopg to do something like the way pyPgSQL does it, LH> but LH> it would be good if they were all the same... AFAIK, ARRAY type is PostgreSQL specific, so it's a bad idea to include it in DB API. LH> Is there a list somewhere of the various % placeholders? Or LH> are LH> they just the regular string ones used for database LH> operations? All placeholders are listed in Python Library Reference (http://www.python.org/doc/current/lib/typesseq-strings.html), but it's strongly recommended to use only '%s' and '%%'. LH> What I was thinking was maybe there could be a %a (or LH> something LH> else if that is already taken) which could automatically LH> format LH> the input as an array. The best way I see is to teach psycopg to recognise Python lists and/or tuples as arrays. -- Denis S. Otkidach http://www.python.ru/ [ru] From anthony at computronix.com Wed Apr 7 10:29:48 2004 From: anthony at computronix.com (Anthony Tuininga) Date: Wed Apr 7 10:29:56 2004 Subject: [DB-SIG] db paramstyle for arrays In-Reply-To: <4073C5C3.6020604@egenix.com> References: <4073C5C3.6020604@egenix.com> Message-ID: <1081348188.30415.10.camel@chl0263.edmonton.computronix.com> On Wed, 2004-04-07 at 03:11, M.-A. Lemburg wrote: > Lee Harr wrote: > >> LH> Is there a special DB API style for inserting array values > >> LH> in > >> LH> to a database? > >> > >> What DB API module do you use? For pyPgSQL the answer is in FAQ > >> (http://pypgsql.sourceforge.net/pypgsql-faq.html): > >> If you want to use ARRAYs, you'll now need to wrap your (nested) > >> lists with PgSQL.PgArray > >> > > > > I am using psycopg. > > > > grep'ng through the psycopg distribution does not reveal > > mention of ARRAY, so I guess it does not support that. > > > > Is there anything about it in the DB API? I looked through pep 249 > > but I do not see anything. I could create a patch > > for psycopg to do something like the way pyPgSQL does it, but > > it would be good if they were all the same... > > The DB API supports doing bulk inserts via .executemany(), > but I'm not sure whether the same thing as inserting ARRAYs > which seem to be a postgresql special data type from your > description. Oracle supports arrays as well as named types -- neither of which are covered by the DB API. I've had to break new ground here with cx_Oracle but it would be nice to get the opinions of other database module authors. Binding arrays is done using standard Python sequences -- nothing controversial there, I would guess. I've had to "guess" the data type from the type of data in the array which of course means that problems occur when there are no elements in the array or when the elements in the array consist only of nulls. That leads to the next step, which is telling cx_Oracle what kind of array you would like to bind. Currently, the DB API specifies integer -- a string with maximum length equal to the integer value type object -- an object of the type given I had to extend it to include a two-tuple of the data type and the number of elements in the array. I don't believe anything different is required to support arrays. I haven't dealt with named types yet so no comments there. In any case, arrays are definitely not PostgreSQL specific. -- Anthony Tuininga anthony@computronix.com Computronix Distinctive Software. Real People. Suite 200, 10216 - 124 Street NW Edmonton, AB, Canada T5N 4A3 Phone: (780) 454-3700 Fax: (780) 454-3838 http://www.computronix.com From davidrushby at yahoo.com Wed Apr 7 11:56:36 2004 From: davidrushby at yahoo.com (David Rushby) Date: Wed Apr 7 11:56:41 2004 Subject: [DB-SIG] db paramstyle for arrays In-Reply-To: <1081348188.30415.10.camel@chl0263.edmonton.computronix.com> Message-ID: <20040407155636.89973.qmail@web11002.mail.yahoo.com> I haven't been following this discussion, so excuse me if this post serves no purpose. I'm just trying to present the perspective of another RDBMS and its Python binding on arrays. --- Anthony Tuininga wrote: > On Wed, 2004-04-07 at 03:11, M.-A. Lemburg wrote: > > The DB API supports doing bulk inserts via .executemany(), > > but I'm not sure whether the same thing as inserting ARRAYs > > which seem to be a postgresql special data type from your > > description. Arrays and executemany are definitely not the same thing in Interbase/Firebird. Arrays are a separate datatype. > Oracle supports arrays as well as named types -- neither of which are > covered by the DB API. I've had to break new ground here with > cx_Oracle but it would be nice to get the opinions of other > database module authors. In Interbase/Firebird, arrays are of fixed size, with a predeclared number of dimensions (up to 16) and number of elements per dimension. Irritatingly, individual array elements cannot be set to NULL. The native Interbase/Firebird database API treats arrays differently from all other data types, and there's no SQL literal representation of arrays, no convenient way to manipulate them in stored procedures or triggers. Frankly, arrays in IB/FB feel like a half-supported feature, a partial-birth abortion. > Binding arrays is done using standard Python sequences -- nothing > controversial there, I would guess. I've had to "guess" the data type > from the type of data in the array which of course means that > problems occur when there are no elements in the array or when > the elements in the array consist only of nulls. That leads to > the next step, which is telling cx_Oracle what kind of array you > would like to bind. In IB/FB, whose type systems are not extensible like PostgreSQL's or even Oracle's, the native API provides a set of type codes against which a bound array field can be matched. IB/FB arrays are homogenous, disallow null elements, and can never have zero length, so the difficulties mentioned above do not arise for kinterbasdb. kinterbasdb is therefore able to transparently convert arrays from (potentially nested) Python sequences on input; to (potentially nested) Python lists on output. Here's the kinterbasdb docs section on arrays: http://kinterbasdb.sourceforge.net/dist_docs/usage.html#adv_param_conv_database_arrays __________________________________ Do you Yahoo!? Yahoo! Small Business $15K Web Design Giveaway http://promotions.yahoo.com/design_giveaway/ From LBIHW at yahoo.com Tue Apr 6 20:45:20 2004 From: LBIHW at yahoo.com (Sonja Moseley) Date: Wed Apr 7 13:07:52 2004 Subject: [DB-SIG] Re: Announcement Message-ID: <200404062353.i36Nrr2W062243@mxzilla8.xs4all.nl> An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/db-sig/attachments/20040406/5ae97705/attachment.html From YIFJOCEBFH at msn.com Thu Apr 8 06:43:46 2004 From: YIFJOCEBFH at msn.com (Paul Looney) Date: Fri Apr 9 13:51:43 2004 Subject: [DB-SIG] Ebay notification - your auction has completed successfully Message-ID: An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/db-sig/attachments/20040408/a618e25e/attachment.html From yermish at compuserve.com Mon Apr 12 06:56:41 2004 From: yermish at compuserve.com (Yermish) Date: Mon Apr 12 12:56:40 2004 Subject: [DB-SIG] have any trouble with health ? we may help you... more In-Reply-To: <9DF116AEI4G76607@python.org> References: <9DF116AEI4G76607@python.org> Message-ID: <0GJ7B94I28F92FIB@compuserve.com> http://fulmon.biz/PH009/?affiliate_id=233642&campaign_id=407 From news at allnet.es Wed Apr 14 09:05:22 2004 From: news at allnet.es (ALLNET-News) Date: Wed Apr 14 09:11:19 2004 Subject: [DB-SIG] =?iso-8859-1?q?Lista_de_precio_actual_de_m=F3viles?= Message-ID: <20040414130522.1E4ED8329BE@webbox243.server-home.net> Estimado comerciante, como prolongaci?n a nuestra publicidad del d?a de ayer le enviamos nuestra lista de precios actualizada de m?viles. Si Usted no puede recibir el archivo adjuntado haga click en este link para descargarlo: http://www.allnet.es/mailing/130404/2004-Moviles_April.pdf Para poder las leer necesitan el ?Acrobat Reader?, cual es gratuito. (http://www.adobe.es/products/acrobat/readstep2.html) Si necesita alg?n m?vil que no se encuentre en nuestra lista de precios, p?ngase en contacto con nosotros. Atentamente Ana Puente Diaz Gerente Comercial ALLNET S.L. Monte do Rei n?33 ? Sof?n 15108 Carballo (A Coru?a) Tlf: +34 - 981 - 75 31 41 Fax: +34 - 981 - 75 32 61 Mail: info@allnet.es Web: www.allnet.es -------------- next part -------------- A non-text attachment was scrubbed... Name: 2004-Moviles_April.pdf Type: application/octet-stream Size: 27490 bytes Desc: not available Url : http://mail.python.org/pipermail/db-sig/attachments/20040414/d6d77c66/2004-Moviles_April-0001.obj From TSchevitz at sfchronicle.com Wed Apr 14 09:25:46 2004 From: TSchevitz at sfchronicle.com (Schevitz, Tanya) Date: Wed Apr 14 09:26:16 2004 Subject: [DB-SIG] Out of Office AutoReply: [Spam?] unknown Message-ID: <82095A7DDA1D5E4A881F351C3E6135EE01541E48@sfc-is3.adsfchron.com> Thank you for your email. I do not work on Thursday and Friday. I will also be out of the office the week of April 12-16 at a conference. Please contact the Metro Desk at 415-777-7102 with any breaking news. Thank you. Tanya Schevitz -------------------- This e-mail message is intended only for the personal use of the recipient(s) named above. If you are not an intended recipient, you may not review, copy or distribute this message. If you have received this communication in error, please notify the San Francisco Chronicle (chronfeedback@sfchronicle.com) immediately by e-mail and delete the original message. From PaulinaNosek at journalist.com Thu Apr 15 20:59:58 2004 From: PaulinaNosek at journalist.com (Colleen Latham) Date: Fri Apr 16 01:38:04 2004 Subject: [DB-SIG] Fwd: why not? Message-ID: <200404160002.i3G026PV013196@mxzilla6.xs4all.nl> An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/db-sig/attachments/20040416/574dd702/attachment.html From info at codestreets.com Sat Apr 17 12:47:24 2004 From: info at codestreets.com (CodeStreets.com) Date: Sat Apr 17 12:55:41 2004 Subject: [DB-SIG] New scripts directory Message-ID: <44796805-635a-4dd4-aaca-79fe316fccb5@IETF.ORG> Hi, We would like to announce a new scripts directory website - http://www.codestreets.com - and we invite you to add your scripts. It's FREE. Best regards, Vlad www.codestreets.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/db-sig/attachments/20040417/c48a3b67/attachment.html From jdooley at ugcs.caltech.edu Sun Apr 25 05:39:37 2004 From: jdooley at ugcs.caltech.edu (James Dooley) Date: Sun Apr 25 05:39:42 2004 Subject: [DB-SIG] New email address for jdooley Message-ID: <200404250939.i3P9dbXJ026749@beg.ugcs.caltech.edu> Either you sent email to me, or someone spammed it on your behalf. Just want to let you know - this email address is no longer valid. All email sent to it is just deleted. thanks, -james From bgailer at alum.rpi.edu Mon Apr 26 08:16:22 2004 From: bgailer at alum.rpi.edu (Bob Gailer) Date: Mon Apr 26 08:12:54 2004 Subject: [DB-SIG] How to close FoxPro tables opened with ODBC In-Reply-To: References: Message-ID: <6.0.0.22.0.20040426061430.03b08fb0@mail.mric.net> I define an ODBC data source using the Microsoft FoxPro DFP Driver. I create a connection using this data source, with the odbc module I create a cursor, and use it to execute a query. The tables referenced by the query are now "tied up", in that I can't erase them (Access denied). The only way I've found to close them is to close the Python session. Is there a way to close these tables without quitting Python? Bob Gailer bgailer@alum.rpi.edu 303 442 2625 home 720 938 2625 cell From mal at egenix.com Mon Apr 26 08:37:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Apr 26 08:37:05 2004 Subject: [DB-SIG] How to close FoxPro tables opened with ODBC In-Reply-To: <6.0.0.22.0.20040426061430.03b08fb0@mail.mric.net> References: <6.0.0.22.0.20040426061430.03b08fb0@mail.mric.net> Message-ID: <408D026C.6010405@egenix.com> Bob Gailer wrote: > I define an ODBC data source using the Microsoft FoxPro DFP Driver. > I create a connection using this data source, with the odbc module > I create a cursor, and use it to execute a query. > The tables referenced by the query are now "tied up", in that I can't > erase them (Access denied). > The only way I've found to close them is to close the Python session. > > Is there a way to close these tables without quitting Python? A possible cause is that a still open transaction blocks the tables from being dropped. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Apr 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ EuroPython 2004, G?teborg, Sweden 41 days left ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From bgailer at alum.rpi.edu Mon Apr 26 08:51:34 2004 From: bgailer at alum.rpi.edu (Bob Gailer) Date: Mon Apr 26 08:48:04 2004 Subject: [DB-SIG] How to close FoxPro tables opened with ODBC In-Reply-To: <408D026C.6010405@egenix.com> References: <6.0.0.22.0.20040426061430.03b08fb0@mail.mric.net> <408D026C.6010405@egenix.com> Message-ID: <6.0.0.22.0.20040426065017.0266eb90@mail.mric.net> At 06:37 AM 4/26/2004, M.-A. Lemburg wrote: >Bob Gailer wrote: >>I define an ODBC data source using the Microsoft FoxPro DFP Driver. >>I create a connection using this data source, with the odbc module >>I create a cursor, and use it to execute a query. >>The tables referenced by the query are now "tied up", in that I can't >>erase them (Access denied). >>The only way I've found to close them is to close the Python session. >>Is there a way to close these tables without quitting Python? > >A possible cause is that a still open transaction blocks >the tables from being dropped. I'm not using any transactions. (I did try connection.commit() anyway, with no effect). Bob Gailer bgailer@alum.rpi.edu 303 442 2625 home 720 938 2625 cell From msanchez at grupoburke.com Mon Apr 26 15:46:24 2004 From: msanchez at grupoburke.com (=?ISO-8859-1?Q?Marcos_S=E1nchez_Provencio?=) Date: Mon Apr 26 15:46:37 2004 Subject: [DB-SIG] How to close FoxPro tables opened with ODBC In-Reply-To: <6.0.0.22.0.20040426065017.0266eb90@mail.mric.net> References: <6.0.0.22.0.20040426061430.03b08fb0@mail.mric.net> <408D026C.6010405@egenix.com> <6.0.0.22.0.20040426065017.0266eb90@mail.mric.net> Message-ID: <408D6710.6030407@grupoburke.com> Try closing the cursor. If that does not work, try closing the connection. It is still better than closing Python absolutely. Bob Gailer wrote: > At 06:37 AM 4/26/2004, M.-A. Lemburg wrote: > >> Bob Gailer wrote: >> >>> I define an ODBC data source using the Microsoft FoxPro DFP Driver. >>> I create a connection using this data source, with the odbc module >>> I create a cursor, and use it to execute a query. >>> The tables referenced by the query are now "tied up", in that I can't >>> erase them (Access denied). >>> The only way I've found to close them is to close the Python session. >>> Is there a way to close these tables without quitting Python? >> >> >> A possible cause is that a still open transaction blocks >> the tables from being dropped. > > > I'm not using any transactions. (I did try connection.commit() anyway, > with no effect). > > Bob Gailer > bgailer@alum.rpi.edu > 303 442 2625 home > 720 938 2625 cell > > _______________________________________________ > DB-SIG maillist - DB-SIG@python.org > http://mail.python.org/mailman/listinfo/db-sig From bgailer at alum.rpi.edu Mon Apr 26 18:27:38 2004 From: bgailer at alum.rpi.edu (Bob Gailer) Date: Mon Apr 26 18:24:55 2004 Subject: [DB-SIG] How to close FoxPro tables opened with ODBC In-Reply-To: <408D6710.6030407@grupoburke.com> References: <6.0.0.22.0.20040426061430.03b08fb0@mail.mric.net> <408D026C.6010405@egenix.com> <6.0.0.22.0.20040426065017.0266eb90@mail.mric.net> <408D6710.6030407@grupoburke.com> Message-ID: <6.0.0.22.0.20040426162705.0260d030@mail.mric.net> At 01:46 PM 4/26/2004, Marcos S?nchez Provencio wrote: >Try closing the cursor. If that does not work, try closing the connection. Been there. Done that. Tables still locked. >It is still better than closing Python absolutely. > >Bob Gailer wrote: > >>At 06:37 AM 4/26/2004, M.-A. Lemburg wrote: >> >>>Bob Gailer wrote: >>> >>>>I define an ODBC data source using the Microsoft FoxPro DFP Driver. >>>>I create a connection using this data source, with the odbc module >>>>I create a cursor, and use it to execute a query. >>>>The tables referenced by the query are now "tied up", in that I can't >>>>erase them (Access denied). >>>>The only way I've found to close them is to close the Python session. >>>>Is there a way to close these tables without quitting Python? >>> >>> >>>A possible cause is that a still open transaction blocks >>>the tables from being dropped. >> >> >>I'm not using any transactions. (I did try connection.commit() anyway, >>with no effect). >> >>Bob Gailer >>bgailer@alum.rpi.edu >>303 442 2625 home >>720 938 2625 cell >> >>_______________________________________________ >>DB-SIG maillist - DB-SIG@python.org >>http://mail.python.org/mailman/listinfo/db-sig > Bob Gailer bgailer@alum.rpi.edu 303 442 2625 home 720 938 2625 cell From bfu at arroyopr.com Mon Apr 26 04:42:40 2004 From: bfu at arroyopr.com (Compton Gillis) Date: Mon Apr 26 19:34:28 2004 Subject: [DB-SIG] Moore 80 items avaIlabble on online shop Message-ID: <2271507816.20040425214140@@arroyopr.com> My dear friend ... Ciaalis readily availablle, no recipe needed ... Cialiis this is newish man weakness mediccine. Cialiis acts in the same way as ViiAgr. Our Company offer lowest cost ... Up to 81 % of patients who take Ciaalis experience an improovemeent in their erections. Wherefore chooze our company ? - Low prices for Generic Medications http://howtobecomehealthy.com/s%76/in%64e%78%2e%70%68p?p%69%64=evap%68%33%38%33%39 Learn more about our company ! Let try it! From msanchez at grupoburke.com Tue Apr 27 05:48:29 2004 From: msanchez at grupoburke.com (=?ISO-8859-1?Q?Marcos_S=E1nchez_Provencio?=) Date: Tue Apr 27 05:48:43 2004 Subject: [DB-SIG] How to close FoxPro tables opened with ODBC In-Reply-To: <6.0.0.22.0.20040426162705.0260d030@mail.mric.net> References: <6.0.0.22.0.20040426061430.03b08fb0@mail.mric.net> <408D026C.6010405@egenix.com> <6.0.0.22.0.20040426065017.0266eb90@mail.mric.net> <408D6710.6030407@grupoburke.com> <6.0.0.22.0.20040426162705.0260d030@mail.mric.net> Message-ID: <408E2C6D.6080103@grupoburke.com> Does it happen when you use odbc with vb (you can use vbs if you don't have vb)? Bob Gailer wrote: > At 01:46 PM 4/26/2004, Marcos S?nchez Provencio wrote: > >> Try closing the cursor. If that does not work, try closing the >> connection. > > > Been there. Done that. Tables still locked. > >> It is still better than closing Python absolutely. >> >> Bob Gailer wrote: >> >>> At 06:37 AM 4/26/2004, M.-A. Lemburg wrote: >>> >>>> Bob Gailer wrote: >>>> >>>>> I define an ODBC data source using the Microsoft FoxPro DFP Driver. >>>>> I create a connection using this data source, with the odbc module >>>>> I create a cursor, and use it to execute a query. >>>>> The tables referenced by the query are now "tied up", in that I can't >>>>> erase them (Access denied). >>>>> The only way I've found to close them is to close the Python session. >>>>> Is there a way to close these tables without quitting Python? >>>> >>>> >>>> >>>> A possible cause is that a still open transaction blocks >>>> the tables from being dropped. >>> >>> >>> >>> I'm not using any transactions. (I did try connection.commit() >>> anyway, with no effect). >> From wnvcole at peppermillcas.com Tue Apr 27 10:52:49 2004 From: wnvcole at peppermillcas.com (Vernon Cole) Date: Tue Apr 27 10:52:59 2004 Subject: [DB-SIG] How to close FoxPro tables opened with ODBC Message-ID: <07AF3C77A0FBD311A99F00508B65203903272C30@sebastian.peppermillcas.com> The ODBC module which comes with the PyWin32 package is not supported by any of the original developers -- and possibly not by anyone else. It often has little problems such as you are describing. I have had good success using ADO. That seems to be the direction in which Microsoft is moving. (Now that everyone ELSE is using ODBC.) ADO can hook up to almost anything if you can figure out the connection string. For that see: http://www.connectionstrings.com There are three different examples for connection to FoxPro. The ADO interface can be found at: Home page: Good luck. ---- Vernon -----Original Message----- From: Marcos S?nchez Provencio [mailto:msanchez@grupoburke.com] Sent: Tuesday, April 27, 2004 3:48 AM To: Bob Gailer Cc: db-sig@python.org Subject: Re: [DB-SIG] How to close FoxPro tables opened with ODBC Does it happen when you use odbc with vb (you can use vbs if you don't have vb)? Bob Gailer wrote: > At 01:46 PM 4/26/2004, Marcos S?nchez Provencio wrote: > >> Try closing the cursor. If that does not work, try closing the >> connection. > > > Been there. Done that. Tables still locked. > >> It is still better than closing Python absolutely. >> >> Bob Gailer wrote: >> >>> At 06:37 AM 4/26/2004, M.-A. Lemburg wrote: >>> >>>> Bob Gailer wrote: >>>> >>>>> I define an ODBC data source using the Microsoft FoxPro DFP Driver. >>>>> I create a connection using this data source, with the odbc module >>>>> I create a cursor, and use it to execute a query. >>>>> The tables referenced by the query are now "tied up", in that I can't >>>>> erase them (Access denied). >>>>> The only way I've found to close them is to close the Python session. >>>>> Is there a way to close these tables without quitting Python? >>>> >>>> >>>> >>>> A possible cause is that a still open transaction blocks >>>> the tables from being dropped. >>> >>> >>> >>> I'm not using any transactions. (I did try connection.commit() >>> anyway, with no effect). >> _______________________________________________ DB-SIG maillist - DB-SIG@python.org http://mail.python.org/mailman/listinfo/db-sig From andy47 at halfcooked.com Wed Apr 28 12:26:02 2004 From: andy47 at halfcooked.com (Andy Todd) Date: Wed Apr 28 12:26:41 2004 Subject: [DB-SIG] cx_Oracle Oracle 10g on Linux Message-ID: <408FDB1A.8090107@halfcooked.com> Hi all, I've just installed Oracle 10g on my Debian box and am now trying to talk to it from Python. I've downloaded and installed cx_Oracle 4.0.1 but when I try and import the module I get an error; """ Python 2.3.3 (#2, Feb 24 2004, 09:29:20) [GCC 3.3.3 (Debian)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import cx_Oracle Traceback (most recent call last): File "", line 1, in ? ImportError: libclntsh.so.10.1: cannot open shared object file: No such file or directory >>> """ For the record, Oracle 10g does have a libclntsh.so (in $ORACLE_HOME/lib) I note that Anthony says that the code works on Linux (http://aspn.activestate.com/ASPN/Mail/Message/db-sig/2011613) so I'm presuming I am missing some configuration. Does anyone have any suggestions? Regards, Andy -- -------------------------------------------------------------------------------- From the desk of Andrew J Todd esq - http://www.halfcooked.com/ From anthony at computronix.com Wed Apr 28 12:53:07 2004 From: anthony at computronix.com (Anthony Tuininga) Date: Wed Apr 28 12:53:23 2004 Subject: [DB-SIG] cx_Oracle Oracle 10g on Linux In-Reply-To: <408FDB1A.8090107@halfcooked.com> References: <408FDB1A.8090107@halfcooked.com> Message-ID: <1083171187.16013.14.camel@chl0263.edmonton.computronix.com> On Wed, 2004-04-28 at 10:26, Andy Todd wrote: > Hi all, > > I've just installed Oracle 10g on my Debian box and am now trying to > talk to it from Python. > > I've downloaded and installed cx_Oracle 4.0.1 but when I try and import > the module I get an error; > > """ > Python 2.3.3 (#2, Feb 24 2004, 09:29:20) > [GCC 3.3.3 (Debian)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> import cx_Oracle > Traceback (most recent call last): > File "", line 1, in ? > ImportError: libclntsh.so.10.1: cannot open shared object file: No such > file or directory > >>> > """ > > For the record, Oracle 10g does have a libclntsh.so (in $ORACLE_HOME/lib) > > I note that Anthony says that the code works on Linux > (http://aspn.activestate.com/ASPN/Mail/Message/db-sig/2011613) so I'm > presuming I am missing some configuration. Does anyone have any suggestions? Sure. Did you try building cx_Oracle from source? I did not provide binaries for Oracle 10g yet but you should be able to build from source without any trouble. If you run into difficulties, send me an e-mail and I'll see if I can help you get things going. Now that Oracle has released Oracle 10g for Windows as well, the next release of cx_Oracle will contain binaries for 10g -- that may be a while yet, though. :-) > Regards, > Andy -- Anthony Tuininga anthony@computronix.com Computronix Distinctive Software. Real People. Suite 200, 10216 - 124 Street NW Edmonton, AB, Canada T5N 4A3 Phone: (780) 454-3700 Fax: (780) 454-3838 http://www.computronix.com From andy47 at halfcooked.com Wed Apr 28 18:20:32 2004 From: andy47 at halfcooked.com (Andy Todd) Date: Wed Apr 28 18:20:39 2004 Subject: [DB-SIG] cx_Oracle Oracle 10g on Linux In-Reply-To: <1083171187.16013.14.camel@chl0263.edmonton.computronix.com> References: <408FDB1A.8090107@halfcooked.com> <1083171187.16013.14.camel@chl0263.edmonton.computronix.com> Message-ID: <40902E30.9020209@halfcooked.com> Anthony Tuininga wrote: > On Wed, 2004-04-28 at 10:26, Andy Todd wrote: > >>Hi all, >> >>I've just installed Oracle 10g on my Debian box and am now trying to >>talk to it from Python. >> >>I've downloaded and installed cx_Oracle 4.0.1 but when I try and import >>the module I get an error; >> >>""" >>Python 2.3.3 (#2, Feb 24 2004, 09:29:20) >>[GCC 3.3.3 (Debian)] on linux2 >>Type "help", "copyright", "credits" or "license" for more information. >> >>> import cx_Oracle >>Traceback (most recent call last): >> File "", line 1, in ? >>ImportError: libclntsh.so.10.1: cannot open shared object file: No such >>file or directory >> >>> >>""" >> >>For the record, Oracle 10g does have a libclntsh.so (in $ORACLE_HOME/lib) >> >>I note that Anthony says that the code works on Linux >>(http://aspn.activestate.com/ASPN/Mail/Message/db-sig/2011613) so I'm >>presuming I am missing some configuration. Does anyone have any suggestions? > > > Sure. Did you try building cx_Oracle from source? I did not provide > binaries for Oracle 10g yet but you should be able to build from source > without any trouble. If you run into difficulties, send me an e-mail and > I'll see if I can help you get things going. Now that Oracle has > released Oracle 10g for Windows as well, the next release of cx_Oracle > will contain binaries for 10g -- that may be a while yet, though. :-) > > >>Regards, >>Andy I was building from source. What I hadn't done was set the LD_LIBRARY_PATH environment variable correctly. It needs to be set to $ORACLE_HOME/lib before starting python and then everything works like a charm. Thanks for your help, Andy -- -------------------------------------------------------------------------------- From the desk of Andrew J Todd esq - http://www.halfcooked.com/ From bgfmeb at hotmail.com Thu Apr 29 13:56:37 2004 From: bgfmeb at hotmail.com (Josef Walker) Date: Fri Apr 30 11:14:03 2004 Subject: [DB-SIG] RE: Meet real people online Message-ID: <2p$9-ec185gz-w7p$njp499@8mr.83> An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/db-sig/attachments/20040429/12b42e26/attachment.html From sorr at rightnow.com Fri Apr 30 12:51:45 2004 From: sorr at rightnow.com (Orr, Steve) Date: Fri Apr 30 12:51:50 2004 Subject: [DB-SIG] cx_Oracle cursor.executemanyprepared() Message-ID: I don't see a test case on the executemanyprepared() function. Can someone give me some sample code to demonstrate how to use this? I need to develop a fast data insert routine for query result sets coming from the MySQLdb python module. I'm thinking about iterating through a MySQL result set (which is list of tuples), say 1,000 or 10,000 rows at a time, followed by mass inserts of those rows into Oracle committing every 1,000 or 10,000 rows. Other suggestions? TIA !!! Steve Orr From rjkimble at alum.mit.edu Fri Apr 30 13:17:56 2004 From: rjkimble at alum.mit.edu (Bob Kimble) Date: Fri Apr 30 13:18:07 2004 Subject: [DB-SIG] cx_Oracle cursor.executemanyprepared() In-Reply-To: References: Message-ID: <200404301317.57656.rjkimble@alum.mit.edu> On Friday 30 April 2004 12:51 pm, Orr, Steve wrote: > I don't see a test case on the executemanyprepared() function. Can > someone give me some sample code to demonstrate how to use this? > > I need to develop a fast data insert routine for query result sets > coming from the MySQLdb python module. I'm thinking about iterating > through a MySQL result set (which is list of tuples), say 1,000 or > 10,000 rows at a time, followed by mass inserts of those rows into > Oracle committing every 1,000 or 10,000 rows. > > Other suggestions? Another approach that I use frequently is to write a "bulk upload" file and then run the bulk upload command in the database. For PostgreSQL it's "COPY FROM ...." I know that Sybase and MS SQL Server have a similar command. Typically a tab separated format is suitable, and it's rather easy to generate. I suspect that Oracle has a similar capability. This technique gives you a copy of the data you're uploading, and the bulk upload commands are usually faster than doing an equivalent number of inserts. You can help matters by deactivating or dropping the indexes before the copy and then reactivating/restoring them afterward. Regards, .... Bob Kimble > > > TIA !!! > Steve Orr > > > _______________________________________________ > DB-SIG maillist - DB-SIG@python.org > http://mail.python.org/mailman/listinfo/db-sig From sorr at rightnow.com Fri Apr 30 13:28:21 2004 From: sorr at rightnow.com (Orr, Steve) Date: Fri Apr 30 13:28:24 2004 Subject: [DB-SIG] cx_Oracle cursor.executemanyprepared() Message-ID: FYI... I'm avoiding the Oracle SQL*Loader product because I'm contemplating large amounts of data and I don't want an intervening file... Just a straight copy of data out of one database engine and into another. Also there's BLOBs and CLOBs to consider. One advantage of SQL*Loader is that you can use the directload and nologging options which saves on the redo and rollback segments. I hope to get around a dependency on the SQL*Loader product by using temporary tables and create table as select (CTAS) nologging or by using some advanced techniques available in OCI. I also plan on creating the indexes AFTER data population using the nologging option. Steve Orr -----Original Message----- From: db-sig-bounces@python.org [mailto:db-sig-bounces@python.org] On Behalf Of Bob Kimble Sent: Friday, April 30, 2004 11:18 AM To: db-sig@python.org Subject: Re: [DB-SIG] cx_Oracle cursor.executemanyprepared() On Friday 30 April 2004 12:51 pm, Orr, Steve wrote: > I don't see a test case on the executemanyprepared() function. Can > someone give me some sample code to demonstrate how to use this? > > I need to develop a fast data insert routine for query result sets > coming from the MySQLdb python module. I'm thinking about iterating > through a MySQL result set (which is list of tuples), say 1,000 or > 10,000 rows at a time, followed by mass inserts of those rows into > Oracle committing every 1,000 or 10,000 rows. > > Other suggestions? Another approach that I use frequently is to write a "bulk upload" file and then run the bulk upload command in the database. For PostgreSQL it's "COPY
FROM ...." I know that Sybase and MS SQL Server have a similar command. Typically a tab separated format is suitable, and it's rather easy to generate. I suspect that Oracle has a similar capability. This technique gives you a copy of the data you're uploading, and the bulk upload commands are usually faster than doing an equivalent number of inserts. You can help matters by deactivating or dropping the indexes before the copy and then reactivating/restoring them afterward. Regards, .... Bob Kimble > > > TIA !!! > Steve Orr > > > _______________________________________________ > DB-SIG maillist - DB-SIG@python.org > http://mail.python.org/mailman/listinfo/db-sig _______________________________________________ DB-SIG maillist - DB-SIG@python.org http://mail.python.org/mailman/listinfo/db-sig From pf_moore at yahoo.co.uk Fri Apr 30 15:04:51 2004 From: pf_moore at yahoo.co.uk (Paul Moore) Date: Fri Apr 30 15:04:48 2004 Subject: [DB-SIG] Re: cx_Oracle cursor.executemanyprepared() References: Message-ID: <8ygd9tik.fsf@yahoo.co.uk> "Orr, Steve" writes: > I need to develop a fast data insert routine for query result sets > coming from the MySQLdb python module. I'm thinking about iterating > through a MySQL result set (which is list of tuples), say 1,000 or > 10,000 rows at a time, followed by mass inserts of those rows into > Oracle committing every 1,000 or 10,000 rows. You do know that for an Oracle database doing a single commit at the end is better than multiple commits as you go through the loop? You need enough rollback to do it, but if you commit in the loop, you risk ORA-01555 (snapshot too old) errors and the need to restart a partially completed load... Other thoughts for the load - use direct-mode inserts (with the /*+ APPEND */ hint) and NOLOGGING tables to reduce redo usage. If you can afford a flat file of the data, external tables (or SQL*Loader in earlier versions of Oracle) are useful. Paul. -- This signature intentionally left blank