cx-oracle-users Mailing List for cx_Oracle (Page 145)
Brought to you by:
atuining
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(5) |
Aug
(9) |
Sep
(8) |
Oct
(12) |
Nov
(4) |
Dec
(8) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(15) |
Feb
(12) |
Mar
(11) |
Apr
(5) |
May
(7) |
Jun
(8) |
Jul
(12) |
Aug
(2) |
Sep
(14) |
Oct
(17) |
Nov
(20) |
Dec
(3) |
2005 |
Jan
(16) |
Feb
(9) |
Mar
(22) |
Apr
(21) |
May
(73) |
Jun
(16) |
Jul
(15) |
Aug
(10) |
Sep
(32) |
Oct
(35) |
Nov
(22) |
Dec
(13) |
2006 |
Jan
(42) |
Feb
(36) |
Mar
(13) |
Apr
(18) |
May
(8) |
Jun
(17) |
Jul
(24) |
Aug
(30) |
Sep
(35) |
Oct
(33) |
Nov
(33) |
Dec
(11) |
2007 |
Jan
(35) |
Feb
(31) |
Mar
(35) |
Apr
(64) |
May
(38) |
Jun
(12) |
Jul
(18) |
Aug
(34) |
Sep
(75) |
Oct
(29) |
Nov
(51) |
Dec
(11) |
2008 |
Jan
(27) |
Feb
(46) |
Mar
(48) |
Apr
(36) |
May
(59) |
Jun
(42) |
Jul
(25) |
Aug
(34) |
Sep
(57) |
Oct
(97) |
Nov
(59) |
Dec
(57) |
2009 |
Jan
(48) |
Feb
(48) |
Mar
(45) |
Apr
(24) |
May
(46) |
Jun
(52) |
Jul
(52) |
Aug
(37) |
Sep
(27) |
Oct
(40) |
Nov
(37) |
Dec
(13) |
2010 |
Jan
(16) |
Feb
(9) |
Mar
(24) |
Apr
(6) |
May
(27) |
Jun
(28) |
Jul
(60) |
Aug
(16) |
Sep
(33) |
Oct
(20) |
Nov
(39) |
Dec
(30) |
2011 |
Jan
(23) |
Feb
(43) |
Mar
(16) |
Apr
(29) |
May
(23) |
Jun
(16) |
Jul
(10) |
Aug
(8) |
Sep
(18) |
Oct
(42) |
Nov
(26) |
Dec
(20) |
2012 |
Jan
(17) |
Feb
(27) |
Mar
|
Apr
(20) |
May
(18) |
Jun
(7) |
Jul
(24) |
Aug
(21) |
Sep
(23) |
Oct
(18) |
Nov
(12) |
Dec
(5) |
2013 |
Jan
(14) |
Feb
(10) |
Mar
(20) |
Apr
(65) |
May
(3) |
Jun
(8) |
Jul
(6) |
Aug
(3) |
Sep
|
Oct
(3) |
Nov
(28) |
Dec
(3) |
2014 |
Jan
(3) |
Feb
(9) |
Mar
(4) |
Apr
(7) |
May
(20) |
Jun
(2) |
Jul
(20) |
Aug
(7) |
Sep
(11) |
Oct
(8) |
Nov
(6) |
Dec
(12) |
2015 |
Jan
(16) |
Feb
(10) |
Mar
(14) |
Apr
(8) |
May
|
Jun
(8) |
Jul
(15) |
Aug
(7) |
Sep
(1) |
Oct
(33) |
Nov
(8) |
Dec
(5) |
2016 |
Jan
(18) |
Feb
(12) |
Mar
(6) |
Apr
(14) |
May
(5) |
Jun
(3) |
Jul
|
Aug
(21) |
Sep
|
Oct
(15) |
Nov
(8) |
Dec
|
2017 |
Jan
|
Feb
(14) |
Mar
(21) |
Apr
(9) |
May
(6) |
Jun
(11) |
Jul
(23) |
Aug
(6) |
Sep
(5) |
Oct
(7) |
Nov
(1) |
Dec
(1) |
2018 |
Jan
|
Feb
|
Mar
(16) |
Apr
(2) |
May
(1) |
Jun
|
Jul
(2) |
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
2019 |
Jan
(2) |
Feb
(3) |
Mar
(1) |
Apr
(1) |
May
|
Jun
|
Jul
(2) |
Aug
(1) |
Sep
(2) |
Oct
|
Nov
|
Dec
(1) |
2020 |
Jan
|
Feb
(4) |
Mar
|
Apr
|
May
(2) |
Jun
(1) |
Jul
(4) |
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(3) |
2021 |
Jan
|
Feb
(5) |
Mar
|
Apr
(7) |
May
(6) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2023 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Anthony T. <an...@co...> - 2004-02-27 15:10:06
|
It isn't strictly necessary to select from dual when you are fetching a sequence value -- but it is the "accepted" way of doing so since dual always has one row. Have you tried selecting from dual and does that solve the problem? It is certainly not necessary to create a stored procedure to do this -- you can do this in two separate SQL statement if you wish or as an anonymous PL/SQL block as well. A stored procedure simply encapsulates the logic in one place and that might be advantageous to you. If you want to proceed further, I would suggest sending us the exact code that you are using and the exact output -- using the interactive command line is ideal if you can do it. Thanks. On Fri, 2004-02-27 at 00:46, Jon and Chiarina Blake wrote: > Hi Antonio, > If you want to treat your sequence like a "table", you must "SELECT > users_seq.nextval FROM DUAL". You'll see the next sequence value if you > execute this statement from an SQL*Plus prompt. > > What you seem to be attempting to do, only makes sence from a PL/SQL block. > Try something like: > > CREATE OR REPLACE PROCEDURE myproc IS > > nval NUMBER; > > BEGIN > SELECT users_seq.nextval INTO nval FROM DUAL; > INSERT INTO xxx VALUES(nval,...); > ... > END; > > Then use cx_Oracle's callproc method to execute procedure myproc. > Hope this helps. > > Regards, > Jon > > ----- Original Message ----- > From: "Antonio Beamud Montero" <ant...@li...> > To: <cx-...@li...> > Sent: Thursday, February 26, 2004 10:56 PM > Subject: [cx-oracle-users] Can't get nextval > > > Hi all: > I've a big problem because I neet to get the nextval in a sequence, and the > query returns an empty sequence. > If I make a query like : INSERT INTO XXXX VALUES (users_seq.nextval, ...) > All works perfectly, but If I try to do this query in two steps: > SELECT users_seq.nextval FROM XXXX > INSERT INTO XXXX VALUES (new_id, ...) > > the SELECT returns []. > (This query works with sqlplus) > > What I'm doin wrong? > > > ------------------------------------------------------- > SF.Net is sponsored by: Speed Start Your Linux Apps Now. > Build and deploy apps & Web services for Linux with > a free DVD software kit from IBM. Click Now! > http://ads.osdn.com/?ad_id56&alloc_id438&op=ick > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > > > > > ------------------------------------------------------- > SF.Net is sponsored by: Speed Start Your Linux Apps Now. > Build and deploy apps & Web services for Linux with > a free DVD software kit from IBM. Click Now! > http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users -- Anthony Tuininga an...@co... 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: Jon a. C. B. <jc....@bi...> - 2004-02-27 07:57:18
|
Hi Antonio, If you want to treat your sequence like a "table", you must "SELECT users_seq.nextval FROM DUAL". You'll see the next sequence value if you execute this statement from an SQL*Plus prompt. What you seem to be attempting to do, only makes sence from a PL/SQL block. Try something like: CREATE OR REPLACE PROCEDURE myproc IS nval NUMBER; BEGIN SELECT users_seq.nextval INTO nval FROM DUAL; INSERT INTO xxx VALUES(nval,...); ... END; Then use cx_Oracle's callproc method to execute procedure myproc. Hope this helps. Regards, Jon ----- Original Message ----- From: "Antonio Beamud Montero" <ant...@li...> To: <cx-...@li...> Sent: Thursday, February 26, 2004 10:56 PM Subject: [cx-oracle-users] Can't get nextval Hi all: I've a big problem because I neet to get the nextval in a sequence, and the query returns an empty sequence. If I make a query like : INSERT INTO XXXX VALUES (users_seq.nextval, ...) All works perfectly, but If I try to do this query in two steps: SELECT users_seq.nextval FROM XXXX INSERT INTO XXXX VALUES (new_id, ...) the SELECT returns []. (This query works with sqlplus) What I'm doin wrong? ------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id56&alloc_id438&op=ick _______________________________________________ cx-oracle-users mailing list cx-...@li... https://lists.sourceforge.net/lists/listinfo/cx-oracle-users |
From: Moore, P. <Pau...@at...> - 2004-02-26 16:54:58
|
From: Antonio Beamud Montero > query =3D "SELECT allocation_seq.nextval FROM allocation" > self._cursor.execute(query) > newid, =3D self._cursor.fetchone() > print newid > But it returns nothing...=20 Select from dual instead of from allocation. I'm guessing that your allocation table is empty. Paul |
From: Antonio B. M. <ant...@li...> - 2004-02-26 16:13:42
|
query =3D "SELECT allocation_seq.nextval FROM allocation" self._cursor.execute(query) newid, =3D self._cursor.fetchone() print newid But it returns nothing...=20 If I do: self._cursor.execute('select * from user_sequences') r =3D self._cursor.fetchall() print r ------------------- [('ALLOCATION_SEQ', 1, 999999999999999999999999999L, 1, 'N', 'N', 20, 81)= ] ------------------- El Jue 26 Feb 2004 15:54, Anthony Tuininga escribi=F3: > Could you send us the exact code you are using? This code works for me: > > import cx_Oracle > > connection =3D cx_Oracle.connect("user/pw@tns") > cursor =3D connection.cursor() > cursor.execute("select users_seq.nextval from dual") > seqValue, =3D cursor.fetchone() > > On Thu, 2004-02-26 at 04:56, Antonio Beamud Montero wrote: > > Hi all: > > I've a big problem because I neet to get the nextval in a sequence, a= nd > > the query returns an empty sequence. > > If I make a query like : INSERT INTO XXXX VALUES (users_seq.nextval, = =2E..) > > All works perfectly, but If I try to do this query in two steps: > > SELECT users_seq.nextval FROM XXXX > > INSERT INTO XXXX VALUES (new_id, ...) > > > > the SELECT returns []. > > (This query works with sqlplus) > > > > What I'm doin wrong? > > > > > > ------------------------------------------------------- > > SF.Net is sponsored by: Speed Start Your Linux Apps Now. > > Build and deploy apps & Web services for Linux with > > a free DVD software kit from IBM. Click Now! > > http://ads.osdn.com/?ad_id56&alloc_id438&op=3Dclick > > _______________________________________________ > > cx-oracle-users mailing list > > cx-...@li... > > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users |
From: Anthony T. <an...@co...> - 2004-02-26 15:04:14
|
Could you send us the exact code you are using? This code works for me: import cx_Oracle connection = cx_Oracle.connect("user/pw@tns") cursor = connection.cursor() cursor.execute("select users_seq.nextval from dual") seqValue, = cursor.fetchone() On Thu, 2004-02-26 at 04:56, Antonio Beamud Montero wrote: > Hi all: > I've a big problem because I neet to get the nextval in a sequence, and the > query returns an empty sequence. > If I make a query like : INSERT INTO XXXX VALUES (users_seq.nextval, ...) > All works perfectly, but If I try to do this query in two steps: > SELECT users_seq.nextval FROM XXXX > INSERT INTO XXXX VALUES (new_id, ...) > > the SELECT returns []. > (This query works with sqlplus) > > What I'm doin wrong? > > > ------------------------------------------------------- > SF.Net is sponsored by: Speed Start Your Linux Apps Now. > Build and deploy apps & Web services for Linux with > a free DVD software kit from IBM. Click Now! > http://ads.osdn.com/?ad_id56&alloc_id438&op=click > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users -- Anthony Tuininga an...@co... 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: Antonio B. M. <ant...@li...> - 2004-02-26 12:06:50
|
Hi all: I've a big problem because I neet to get the nextval in a sequence, and t= he=20 query returns an empty sequence.=20 If I make a query like : INSERT INTO XXXX VALUES (users_seq.nextval, ...) All works perfectly, but If I try to do this query in two steps: SELECT users_seq.nextval FROM XXXX INSERT INTO XXXX VALUES (new_id, ...) the SELECT returns []. (This query works with sqlplus) What I'm doin wrong? |
From: Anthony T. <an...@co...> - 2004-02-17 15:03:57
|
The only other interesting piece of information might be the following: Python exceptions have an "args" attribute which in this case is a singleton tuple containing an error info object. This error info object has three attributes: code - the numeric Oracle code message - the message that is obtained via str(exceptionValue) context - the context in which the error was raised As to your other question about the fact that cx_Oracle always raises DatabseError when it would seem more reasonable to return something like DataError -- I haven't gone to the trouble of creating a mapping between Oracle errors and DB API errors. Someone (possibly on this list) said they were going to send me patches for this but I haven't heard from them in several months so perhaps not.... If you would like to pick up that ball, I'm quite willing to accept patches. :-) Otherwise, I have other things which I would like to do that I would consider higher priority... :-) On Tue, 2004-02-17 at 04:30, ????? ???? wrote: > Hi, > > > > Try like in this > short example: > > > ------------------------------------------------<cut>----------------------- > -------------------- > try: > my_connection=cx_Oracle.connect('system/manager@test_db') > except cx_Oracle.DatabaseError,info: > print "Logon Error:",info > exit(0) > > my_cursor=my_connection.cursor() > try: > my_cursor.execute(""" > SELECT ROWID,O.* FROM TESTER.PODR O """) > except cx_Oracle.DatabaseError,info: > print "SQL Error:",info > exit(0) > ------------------------------<end cut > >------------------------------------- > > > Best regards, > > Oleg Popov > op...@ya... > > > ----- Original Message ----- > From: "Jeff Wong" <jef...@sa...> > To: <cx-...@li...> > Sent: Monday, February 16, 2004 11:41 PM > Subject: [cx-oracle-users] Extracting Oracle error codes, characterizing > exceptions > > > > Is there way to extract Oracle error codes other than by applying str() to > > the exception and parsing the string? > > > > Also, if I cannot connect to the Oracle database would that be a > > DatabaseError or an InternalError? > > > > I am trying to use cx_Oracle to write a server that needs to be reliable > > and I am trying to figure out how to handle possible exceptions returned > > from Oracle. > > > > I also noticed that violations of table constraints are DatabaseErrors, > > rather than DataErrors. Is this intended? What are examples of > > DataErrors? > > > > Thanks, > > > > Jeff > > > > > > > > > > > > > > ------------------------------------------------------- > > SF.Net is sponsored by: Speed Start Your Linux Apps Now. > > Build and deploy apps & Web services for Linux with > > a free DVD software kit from IBM. Click Now! > > http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click > > _______________________________________________ > > cx-oracle-users mailing list > > cx-...@li... > > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > > > > > > ------------------------------------------------------- > SF.Net is sponsored by: Speed Start Your Linux Apps Now. > Build and deploy apps & Web services for Linux with > a free DVD software kit from IBM. Click Now! > http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users -- Anthony Tuininga an...@co... 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: ????? ???? <op...@sa...> - 2004-02-17 11:37:38
|
Hi, Try like in this short example: ------------------------------------------------<cut>----------------------- -------------------- try: my_connection=cx_Oracle.connect('system/manager@test_db') except cx_Oracle.DatabaseError,info: print "Logon Error:",info exit(0) my_cursor=my_connection.cursor() try: my_cursor.execute(""" SELECT ROWID,O.* FROM TESTER.PODR O """) except cx_Oracle.DatabaseError,info: print "SQL Error:",info exit(0) ------------------------------<end cut >------------------------------------- Best regards, Oleg Popov op...@ya... ----- Original Message ----- From: "Jeff Wong" <jef...@sa...> To: <cx-...@li...> Sent: Monday, February 16, 2004 11:41 PM Subject: [cx-oracle-users] Extracting Oracle error codes, characterizing exceptions > Is there way to extract Oracle error codes other than by applying str() to > the exception and parsing the string? > > Also, if I cannot connect to the Oracle database would that be a > DatabaseError or an InternalError? > > I am trying to use cx_Oracle to write a server that needs to be reliable > and I am trying to figure out how to handle possible exceptions returned > from Oracle. > > I also noticed that violations of table constraints are DatabaseErrors, > rather than DataErrors. Is this intended? What are examples of > DataErrors? > > Thanks, > > Jeff > > > > > > > ------------------------------------------------------- > SF.Net is sponsored by: Speed Start Your Linux Apps Now. > Build and deploy apps & Web services for Linux with > a free DVD software kit from IBM. Click Now! > http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > |
From: Jeff W. <jef...@sa...> - 2004-02-16 19:45:30
|
Is there way to extract Oracle error codes other than by applying str() to the exception and parsing the string? Also, if I cannot connect to the Oracle database would that be a DatabaseError or an InternalError? I am trying to use cx_Oracle to write a server that needs to be reliable and I am trying to figure out how to handle possible exceptions returned from Oracle. I also noticed that violations of table constraints are DatabaseErrors, rather than DataErrors. Is this intended? What are examples of DataErrors? Thanks, Jeff |
From: Jeff W. <jef...@sa...> - 2004-01-30 22:00:35
|
Hi, Let's say I'm running an execute_many() on an SQL statement and at some point I decide it's taking to long. What is the best or cleanest way to terminate this execution? Here's some further background info: I have 2 threads: one which does database insertions, and another which monitors that thread. From the monitoring thread, I want to arbitrarily raise an exception such that the inserting thread stops what it's doing. The insertion thread does the "insertions" is the MainThread. I've tried: 1) Sending a SIGTERM to the MainThread, catching it in a handler that I have installed, and doing sys.exit() from the handler. 2) Calling sys.exit() from the monitoring thread when the insertion thread is busy doing the execute many. 3) Sending a SIGINT to the MainThread. None of these terminate the transaction execute_many() right away. Is there any way to do this on cx_Oracle 3.0? I noticed that Connection objects in 4.0 have cancel() function. Is this what I want? TIA, Jeff |
From: Anthony T. <an...@co...> - 2004-01-21 16:19:43
|
It is possible but the method isn't much of an improvement over the code below. :-( If anyone has an idea of how to create an exception in C that makes this a little more reasonable, please let me know! except cx_Oracle.DatabaseError, e: errorObj, = e.args if errorObj.code == 904: # handle this error There are three attributes on the errorObj object: code --> the numeric error code reported by Oracle message --> the message reported by Oracle context --> internal context in which the error was raised Hope that helps. On Wed, 2004-01-21 at 09:05, Moore, Paul wrote: > I want to trap a particular Oracle error (904, invalid column name). > At the moment, I'm doing that by > > except cx_Oracle.DatabaseError, e: > if str(e).startswith("ORA-00904"): > # handle this error > > While I can't imagine that the string format of the error will ever > change enough to make this invalid, I'd prefer to check the error number > directly. But I can't see a way of getting that number. > > Am I missing it, or is this not possible? > > Thanks, > Paul. > > > ------------------------------------------------------- > The SF.Net email is sponsored by EclipseCon 2004 > Premiere Conference on Open Tools Development and Integration > See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. > http://www.eclipsecon.org/osdn > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users -- |
From: Moore, P. <Pau...@at...> - 2004-01-21 16:06:00
|
I want to trap a particular Oracle error (904, invalid column name). At the moment, I'm doing that by except cx_Oracle.DatabaseError, e: if str(e).startswith("ORA-00904"): # handle this error While I can't imagine that the string format of the error will ever change enough to make this invalid, I'd prefer to check the error number directly. But I can't see a way of getting that number. Am I missing it, or is this not possible? Thanks, Paul. |
From: Neves <Loo...@29...> - 2004-01-20 18:21:50
|
E-mail is the fastest growing marketing tool. We offer E-mail Marketing with quality service and the lowest prices. 1. Targeted E-mail Addresses We can provide targeted e-mail addresses you need, which are compiled only on your order. We will customize your customer e-mail addresses. * We have millions of e-mail addresses in a wide variety of categories. 2. Send out Targeted E-mails for you We can send your e-mail message to your targeted customers! We will customize your email addresses and send your message for you. * We can Bullet-Proof your Web Site. We also offer a wide variety of marketing software. For more details, you can refer to: Http://www.Marketing-Savant.com Looking forward to serving you, and your business needs! Regards! Tony Madu Marketing Support www.Marketing-Savant.com Sa...@Ma... ************************************************************************* To remove your address from list: http://quicktell.net/responder/delist.cgi/q/3/17134747/142960 ************************************************************************* |
From: Moore, P. <Pau...@at...> - 2004-01-19 16:09:17
|
It should be available from the gmane archive (see http://www.gmane.org). Having said that, the group isn't there yet, but that may just be because no messages have been posted since the group creation. Hopefully, this message will fix that :-) Paul. |
From: Anthony T. <an...@co...> - 2004-01-16 18:47:37
|
You need to have your Oracle client installed. If you have it installed, make sure the environment variable ORACLE_HOME points to the correct location. On Fri, 2004-01-16 at 11:48, chr...@ne... wrote: > Anthony, > > Thanks. When I run the setup.py build, I get the following error message: > > Traceback (most recent call last): > File "setup.py", line 34, in ? > oracleHome = os.environ["ORACLE_HOME"] > File "/usr/lib/python2.3/UserDict.py", line 19, in __getitem__ > def __getitem__(self, key): return self.data[key] > KeyError: 'ORACLE_HOME' > > Thanks again, > Chris > > ----- Original Message ----- > From: Anthony Tuininga > Sent: 1/16/2004 7:21:00 AM > To: ch...@ja... > Cc: cx-...@li... > Subject: Re: [cx-oracle-users] Installation problem on mandrake 9.2 > > > Try executing the following: > > > > rpm -qa | grep cx_Oracle > > > > and see if anything turns up. If so, execute the following: > > > > rpm -ql cx_Oracle > > > > and note where the files are located. It is possible that your Python > > installation and the cx_Oracle RPM are not compatible -- your Python > > executes in /usr/local/bin but the cx_Oracle RPM expects a Python from > > /usr/bin. > > > > If the RPM doesn't work for you, you should be able to download the > > source and execute (from within the directory where the source was > > extracted): > > > > python setup.py build > > python setup.py install > > > > and that should install it for you. > > > > Hope that helps. > > > > On Thu, 2004-01-15 at 18:00, Christopher Abrams wrote: > > > Hello cx-oracle-users, > > > > > > I'm having trouble installing cx_Oracle 4.0 on a Mandrake 9.2 box. I > > > am fairly new to Mandrake and Linux in general. I've tried to search > > > for a package for cx_Oracle using drakconf (urpmi), but I haven't had > > > any luck. I've also searched around the web for some help. I > > > downloaded the rpm from the cx_Oracle page, but when I rpm -i the > > > package doesn't seem to get installed. I also don't get any error > > > messages. If anyone knows of anything that would help, it would be > > > greatly appreciated. > > > > > > Thanks, > > > Chris > > > > > > > > > ------------------------------------------------------- > > > The SF.Net email is sponsored by EclipseCon 2004 > > > Premiere Conference on Open Tools Development and Integration > > > See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. > > > http://www.eclipsecon.org/osdn > > > _______________________________________________ > > > cx-oracle-users mailing list > > > cx-...@li... > > > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > > -- > > Anthony Tuininga > > an...@co... > > > > 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 > > > > > > > > ------------------------------------------------------- > > The SF.Net email is sponsored by EclipseCon 2004 > > Premiere Conference on Open Tools Development and Integration > > See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. > > http://www.eclipsecon.org/osdn > > _______________________________________________ > > cx-oracle-users mailing list > > cx-...@li... > > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users -- Anthony Tuininga an...@co... 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: <chr...@ne...> - 2004-01-16 18:43:52
|
Anthony, Thanks=2E When I run the setup=2Epy build, I get the following error message:= Traceback (most recent call last): File "setup=2Epy", line 34, in ? oracleHome =3D os=2Eenviron["ORACLE_HOME"] File "/usr/lib/python2=2E3/UserDict=2Epy", line 19, in __getitem__ def __getitem__(self, key): return self=2Edata[key] KeyError: 'ORACLE_HOME' Thanks again, Chris ----- Original Message ----- From: Anthony Tuininga Sent: 1/16/2004 7:21:00 AM To: chrisa@jakks=2Enet Cc: cx-oracle-users@lists=2Esourceforge=2Enet Subject: Re: [cx-oracle-users] Installation problem on mandrake 9=2E2 > Try executing the following: >=20 > rpm -qa | grep cx_Oracle >=20 > and see if anything turns up=2E If so, execute the following: >=20 > rpm -ql cx_Oracle >=20 > and note where the files are located=2E It is possible that your Python > installation and the cx_Oracle RPM are not compatible -- your Python > executes in /usr/local/bin but the cx_Oracle RPM expects a Python from > /usr/bin=2E >=20 > If the RPM doesn't work for you, you should be able to download the > source and execute (from within the directory where the source was > extracted): >=20 > python setup=2Epy build > python setup=2Epy install >=20 > and that should install it for you=2E >=20 > Hope that helps=2E >=20 > On Thu, 2004-01-15 at 18:00, Christopher Abrams wrote: > > Hello cx-oracle-users, > >=20 > > I'm having trouble installing cx_Oracle 4=2E0 on a Mandrake 9=2E2 box=2E= I > > am fairly new to Mandrake and Linux in general=2E I've tried to search > > for a package for cx_Oracle using drakconf (urpmi), but I haven't had > > any luck=2E I've also searched around the web for some help=2E I > > downloaded the rpm from the cx_Oracle page, but when I rpm -i the > > package doesn't seem to get installed=2E I also don't get any error > > messages=2E If anyone knows of anything that would help, it would be > > greatly appreciated=2E > >=20 > > Thanks, > > Chris > >=20 > >=20 > > ------------------------------------------------------- > > The SF=2ENet email is sponsored by EclipseCon 2004 > > Premiere Conference on Open Tools Development and Integration > > See the breadth of Eclipse activity=2E February 3-5 in Anaheim, CA=2E > > http://www=2Eeclipsecon=2Eorg/osdn > > _______________________________________________ > > cx-oracle-users mailing list > > cx-oracle-users@lists=2Esourceforge=2Enet > > https://lists=2Esourceforge=2Enet/lists/listinfo/cx-oracle-users > --=20 > Anthony Tuininga > anthony@computronix=2Ecom > =20 > Computronix > Distinctive Software=2E Real People=2E > Suite 200, 10216 - 124 Street NW > Edmonton, AB, Canada T5N 4A3 > Phone:=09(780) 454-3700 > Fax:=09(780) 454-3838 > http://www=2Ecomputronix=2Ecom >=20 >=20 >=20 > ------------------------------------------------------- > The SF=2ENet email is sponsored by EclipseCon 2004 > Premiere Conference on Open Tools Development and Integration > See the breadth of Eclipse activity=2E February 3-5 in Anaheim, CA=2E > http://www=2Eeclipsecon=2Eorg/osdn > _______________________________________________ > cx-oracle-users mailing list > cx-oracle-users@lists=2Esourceforge=2Enet > https://lists=2Esourceforge=2Enet/lists/listinfo/cx-oracle-users |
From: Anthony T. <an...@co...> - 2004-01-16 15:21:14
|
Try executing the following: rpm -qa | grep cx_Oracle and see if anything turns up. If so, execute the following: rpm -ql cx_Oracle and note where the files are located. It is possible that your Python installation and the cx_Oracle RPM are not compatible -- your Python executes in /usr/local/bin but the cx_Oracle RPM expects a Python from /usr/bin. If the RPM doesn't work for you, you should be able to download the source and execute (from within the directory where the source was extracted): python setup.py build python setup.py install and that should install it for you. Hope that helps. On Thu, 2004-01-15 at 18:00, Christopher Abrams wrote: > Hello cx-oracle-users, > > I'm having trouble installing cx_Oracle 4.0 on a Mandrake 9.2 box. I > am fairly new to Mandrake and Linux in general. I've tried to search > for a package for cx_Oracle using drakconf (urpmi), but I haven't had > any luck. I've also searched around the web for some help. I > downloaded the rpm from the cx_Oracle page, but when I rpm -i the > package doesn't seem to get installed. I also don't get any error > messages. If anyone knows of anything that would help, it would be > greatly appreciated. > > Thanks, > Chris > > > ------------------------------------------------------- > The SF.Net email is sponsored by EclipseCon 2004 > Premiere Conference on Open Tools Development and Integration > See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. > http://www.eclipsecon.org/osdn > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users -- Anthony Tuininga an...@co... 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: Christopher A. <ch...@ja...> - 2004-01-16 01:00:22
|
Hello cx-oracle-users, I'm having trouble installing cx_Oracle 4.0 on a Mandrake 9.2 box. I am = fairly new to Mandrake and Linux in general. I've tried to search for a = package for cx_Oracle using drakconf (urpmi), but I haven't had any = luck. I've also searched around the web for some help. I downloaded the = rpm from the cx_Oracle page, but when I rpm -i the package doesn't seem = to get installed. I also don't get any error messages. If anyone knows = of anything that would help, it would be greatly appreciated. Thanks, Chris |
From: Anthony T. <an...@co...> - 2004-01-15 17:26:37
|
On Thu, 2004-01-15 at 09:32, Moore, Paul wrote: > From: Anthony Tuininga [mailto:an...@co...] > > Could you explain about the "cursors only used from a single > > thread" problem is? > > Sorry. Basically, I'm running a query against lots of databases, > and storing the results in a central database. So I have a single > connection to the central DB, against which I'm running a series > of inserts. Ok, that makes sense now. :-) > Hmm, maybe I should be sharing the central *connection* between > the multiple threads, and creating individual cursors to do the > inserts on a per-thread basis. Is that OK? (Am I reading the > documentation right that I can share a connection, but not a > cursor?) Yes, you can share the connection, but don't try sharing a cursor, unless you like segfaults, of course. :-) > > > I am assuming here that you have one connection per > > thread and therefore one cursor per thread so there shouldn't > > be a problem here, right? > > It's passing the data back to a central update thread that hurts. > Mucking about with queues, knowing when the threads have completed, > etc :-( Although you __can__ create a separate cursor for each thread and perform the insert in each separate thread, if you have a large number of them, this can hurt you. At that point, the queue will work in your favor because the prepare() phase can be skipped. The difference is probably a few milliseconds per thread so it is significantly smaller than the connection overhead (at least 35 ms). Your call. :-) > > This code: > [...] > > will definitely be slower than this code: > > > def PerformQuery(db): > > connection = cx_Oracle.connect("user", "pw", db) > > cursor = connection.cursor() > > cursor.execute("some_query") > > > for db in listOfDbs: > > thread = thread.start_new_thread(PerformQuery, (db,)) > > > Of course, you need to add synchronization code which is completely > > missing but I can help you with that, if needed. I've written a few > > threaded programs and I know the pitfalls that can suddenly open up > > beneath your feet. :-) > > Thanks for the offer. I've managed to find a lot of thread pitfalls > myself :-) They're amazingly easy to find, eh? That's why I've written a few simple classes to manage such things as queues and the like so that I don't have to think about it each time. :-) > How likely is the following sketch to work? (I'll try it, but one of > the things I have learned is that running a threaded program twice > exposes two different sets of bugs :-)) > > cx_Oracle.OPT_Threading = 1 # I think I need this? Yes, you definitely need this. Without it, your program will crash and burn rather quickly. It turns on Oracle threading mode. I've considered making this a part of the connect() method but it really does need to be global. Perhaps another method might make it more clear. Something like this, perhaps? cx_Oracle.setthreaded() Any thoughts on that? > def PerformQuery(db, cn): > connection = cx_Oracle.connect("user", "pw", db) > cursor = connection.cursor() > cursor.execute("some_query") > ins = cn.cursor() > insert_data = process(cursor.fetchall()) > ins.executemany("insert_sql", insert_data) > > cn = cx_Oracle.connect("user", "pw", "centraldb") > threadlist = [] > for db in listOfDbs: > thread = thread.start_new_thread(PerformQuery, (db, cn)) > threadlist.append(thread) > > for thread in threadlist: > thread.join() > > cn.commit() > cn.close() Yes, this should work. Of course, you might want to decide whether you want to use the threading module or the thread module and then make the necessary changes. :-) > Paul -- Anthony Tuininga an...@co... 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: Moore, P. <Pau...@at...> - 2004-01-15 16:32:40
|
From: Anthony Tuininga [mailto:an...@co...] > Could you explain about the "cursors only used from a single > thread" problem is? Sorry. Basically, I'm running a query against lots of databases, and storing the results in a central database. So I have a single connection to the central DB, against which I'm running a series of inserts. Hmm, maybe I should be sharing the central *connection* between the multiple threads, and creating individual cursors to do the inserts on a per-thread basis. Is that OK? (Am I reading the documentation right that I can share a connection, but not a cursor?) > I am assuming here that you have one connection per > thread and therefore one cursor per thread so there shouldn't > be a problem here, right? It's passing the data back to a central update thread that hurts. Mucking about with queues, knowing when the threads have completed, etc :-( > This code: [...] > will definitely be slower than this code: > def PerformQuery(db): > connection =3D cx_Oracle.connect("user", "pw", db) > cursor =3D connection.cursor() > cursor.execute("some_query") > for db in listOfDbs: > thread =3D thread.start_new_thread(PerformQuery, (db,)) > Of course, you need to add synchronization code which is completely > missing but I can help you with that, if needed. I've written a few > threaded programs and I know the pitfalls that can suddenly open up > beneath your feet. :-) Thanks for the offer. I've managed to find a lot of thread pitfalls myself :-) How likely is the following sketch to work? (I'll try it, but one of the things I have learned is that running a threaded program twice exposes two different sets of bugs :-)) cx_Oracle.OPT_Threading =3D 1 # I think I need this? def PerformQuery(db, cn): connection =3D cx_Oracle.connect("user", "pw", db) cursor =3D connection.cursor() cursor.execute("some_query") ins =3D cn.cursor() insert_data =3D process(cursor.fetchall()) ins.executemany("insert_sql", insert_data) cn =3D cx_Oracle.connect("user", "pw", "centraldb") threadlist =3D [] for db in listOfDbs: thread =3D thread.start_new_thread(PerformQuery, (db, cn)) threadlist.append(thread) for thread in threadlist: thread.join() cn.commit() cn.close() Paul |
From: Anthony T. <an...@co...> - 2004-01-15 15:03:15
|
Oracle's threading overhead is about 10-15% so this likely will not be a huge issue. Could you explain about the "cursors only used from a single thread" problem is? I am assuming here that you have one connection per thread and therefore one cursor per thread so there shouldn't be a problem here, right? This code: for db in listOfDbs: connection = cx_Oracle.connect("user", "pw", db) cursor = connection.cursor() cursor.execute("some_query") will definitely be slower than this code: def PerformQuery(db): connection = cx_Oracle.connect("user", "pw", db) cursor = connection.cursor() cursor.execute("some_query") for db in listOfDbs: thread = thread.start_new_thread(PerformQuery, (db,)) Of course, you need to add synchronization code which is completely missing but I can help you with that, if needed. I've written a few threaded programs and I know the pitfalls that can suddenly open up beneath your feet. :-) On Thu, 2004-01-15 at 04:54, Moore, Paul wrote: > I have a program which needs to connect to a large number of > databases. Each connection is fairly short-lived (run a single SQL > query), but the connect times can be quite long, particularly as some > databases may be inaccessible due to network issues, and so there's a > long wait for timeouts. > > What I'd like to do is to create all of my connections "in parallel", > and then run the queries as the connections are ready. This would > reduce the runtime of my application from the sum of all the connect > times (plus a fixed overhead) to the maximum connect time (plus a > possibly different fixed overhead). > > At the moment, I'm doing this using multiple threads, but the extra > code needed to handle the threads, and to make sure that cursors are > only used from a single thread, is non-trivial. And there's also > Oracle's threading overhead. > > Is there a simpler way of doing this, that I am missing? I need a > solution which will handle 100 or so connections, and will scale > reasonably sensibly. My initial thought was that some form of > non-blocking connect might work (I'm not an OCI expert), but when I > scanned the OCI manuals, it doesn't seem like OCI lets you do any > other database work while a nonblocking connect is in progress. > > Can anyone suggest anything? > > Thanks, > Paul Moore. > > > ------------------------------------------------------- > This SF.net email is sponsored by: Perforce Software. > Perforce is the Fast Software Configuration Management System offering > advanced branching capabilities and atomic changes on 50+ platforms. > Free Eval! http://www.perforce.com/perforce/loadprog.html > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users -- Anthony Tuininga an...@co... 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: Moore, P. <Pau...@at...> - 2004-01-15 11:54:38
|
I have a program which needs to connect to a large number of databases. Each connection is fairly short-lived (run a single SQL query), but the connect times can be quite long, particularly as some databases may be inaccessible due to network issues, and so there's a long wait for timeouts. What I'd like to do is to create all of my connections "in parallel", and then run the queries as the connections are ready. This would reduce the runtime of my application from the sum of all the connect times (plus a fixed overhead) to the maximum connect time (plus a possibly different fixed overhead). At the moment, I'm doing this using multiple threads, but the extra code needed to handle the threads, and to make sure that cursors are only used from a single thread, is non-trivial. And there's also Oracle's threading overhead. Is there a simpler way of doing this, that I am missing? I need a solution which will handle 100 or so connections, and will scale reasonably sensibly. My initial thought was that some form of non-blocking connect might work (I'm not an OCI expert), but when I scanned the OCI manuals, it doesn't seem like OCI lets you do any other database work while a nonblocking connect is in progress. Can anyone suggest anything? Thanks, Paul Moore. |
From: Anthony T. <an...@co...> - 2004-01-08 22:23:05
|
It has recently come to my attention that the presence of Time() and TimeFromTicks() in cx_Oracle is misleading at best since Oracle does not support the concept of a time only column. The DB API document does not indicate that these constructors are optional so I was wondering what the consensus of this list would be on what ought to be done. 1) Remove the constructors. 2) Raise an exception when these constructors are used, indicating that Oracle doesn't support the concept. I lean towards number 2 myself but would like some feedback from others on the list. In both cases the documentation will be updated to indicate why these constructors do not work (or are not present). It would also be useful if the DB API document would be modified appropriately since (apparently) not all databases support the concept of time only columns. There might be others that I am not aware of. -- Anthony Tuininga an...@co... 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: Anthony T. <an...@co...> - 2003-12-18 22:56:50
|
I forgot to test all of the permutations and combinations on the less commonly used platforms (Alpha, HP-UX and Solaris and perhaps others) and I uncovered a couple of small bugs. :-( These have already been fixed (today) but since they affect a very small portion of the code I am going to hold off on releasing for at least a couple of weeks. If you are directly affected by this, I can send you modified sources or binaries. If you are running Windows or Linux (x86) you are not affected by these bugs. 1) cursor.bindnames() will cause cx_Oracle to crash 2) Session pooling will not function because of a missing trailing NULL in the keyword parameters. If you have any questions, fire away. And my apologies in advance to those people who will be affected by these oopses. If you discover anything else, please let me know as soon as possible so that I can include any changes in a 4.0.1 release early next year. -- Anthony Tuininga an...@co... 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: Antonio B. M. <ant...@li...> - 2003-12-18 16:44:55
|
Well... I have get a reduced versión of the client runtime, but now it has a size of 38 Mb... I have added the ocommon/nls/admin/data/* to my rpm package and all works fine... Thanks for all... El jue, 18-12-2003 a las 16:53, Branimir Petrovic escribió: > >Need I other libraries? > >When I installed the full oracle client all works correctly... > > At place I work at we had the similar idea - to include only few > needed items from Oracle Client install, in order to avoid the > rest of the bloat and we also faced similar problems. We then asked > Oracle for help in hunting/pinpointing what's needed and what can > safely be ignored and got somewhat surprising answer that although > that would be technically possible we are NOT allowed to do so. > Apparently some "fine print" explicitly forbids taking just few > selected pieces from Oracle Client, instead you must install ALL > that comes with it or else license to use the client is violated. > To stay on the "safe side" we have to keep installing full 300+MB > of Oracle Client (9i) in order to be able to run our app that is > 1/6 in size. Does not make sense, but - that's how it has to be... > > Branimir > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: IBM Linux Tutorials. > Become an expert in LINUX or just sharpen your skills. Sign up for IBM's > Free Linux Tutorials. Learn everything from the bash shell to sys admin. > Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users -- Antonio Beamud Montero <ant...@li...> |