cx-oracle-users Mailing List for cx_Oracle (Page 144)
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: <ser...@ac...> - 2004-06-02 10:48:36
|
Hi all, =20 I'm trying to set up cx_oracle 4.0.1 on a solaris box where Oracle 9.2.0 is installed. When I run "python setup.py build" I get the following error: =20 running build running build_ext building 'cx_Oracle' extension gcc -shared build/temp.solaris-2.8-sun4u-2.3/cx_Oracle.o -L/opt/app/oracle/product/9.2.0/lib -lclntsh -o build/lib.solaris-2.8-sun4u-2.3/cx_Oracle.so -s ld: fatal: file /opt/app/oracle/product/9.2.0/lib/libclntsh.so: wrong ELF class: ELFCLASS64 ld: fatal: File processing errors. No output written to build/lib.solaris-2.8-sun4u-2.3/cx_Oracle.so collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 =20 =20 Any help would be appreciated. Thanks in advance. ---Sergi This message is for the designated recipient only and may contain = privileged, proprietary, or otherwise private information. If you have = received it in error, please notify the sender immediately and delete = the original. Any other use of the email by you is prohibited. |
From: <wa...@li...> - 2004-05-26 19:53:27
|
Hello list! I'm trying to get Unicode data out of Oracle 9.2.0.1.0 with cx_Oracle 4.0.1 and so far didn't have any luck. The database character set of the Oracle instance is WE8ISO8859P1 and the national character set is AL16UTF16. The environment variable NLS_LANG is set to GERMAN_GERMANY.WE8ISO8859P1. All Unicode data is in NVARCHAR2 columns. Doing a select and fetching the data gives me something like this: >>> import cx_Oracle >>> db = cx_Oracle.connect("...") >>> c = db.cursor() >>> c.execute("select m_name from ma_lang where spr_id=40") [<StringVar object at 0x4019e1d0>] >>> d = c.fetchone() >>> d ('\xbf\xbf\xbf\xbf\xbf ... >>> That's something that I expected, because the text is in russian and Oracle seems to use a strange replacement character (U+00BF 'INVERTED QUESTION MARK') for characters that are not transcodable. The strange thing is that setting NLS_LANG to GERMAN_GERMANY.UTF8 doesn't fix the problem. With this setting the result is ('\xc2\xbf\xc2\xbf\xc2\xbf\xc2\xbf ... (i.e. UTF-8 encoded U+00BF) The data in the database is definitely correct, because using Oracles dump() function reveals bytes that look like UTF-16-BE encoded russian text: >>> c.execute("select dump(m_name, 1010) from ma_lang where spr_id=40") [<StringVar object at 0x4019e1d0>] >>> d = c.fetchone() >>> d ('Typ=1 Len=94 CharacterSet=AL16UTF16: 4,26,4,62,4,61,4,50,4,53 ... We're using a Web application written in Java/Struts for entering the text and the text is displaced correctly there too. Unfortunately there's no source for the Oracle/Java driver. Using unistr() seems to work a little better: >>> c.execute("select unistr(m_name) from ma_lang where spr_id=40") [<StringVar object at 0x4019e1d0>] >>> d = c.fetchone() >>> d ('\x04\x1a\x04>\x04=\x042\x045\x049\x045 ... but this break down as soon as there's a backslash in the string. Googling for cx_Oracle and unicode didn't reveal any answers either (just more questions or unrelated stuff) Does anybody know how to get Unicode out of NVARCHAR2 columns with cx_Oracle? Bye, Walter Dörwald |
From: Andy T. <an...@ha...> - 2004-05-25 19:10:15
|
Randall Smith wrote: > I installed the oracle client 8.1.7 on Debian SID. I have Python > version 2.3.3 installed. I downloaded > cx_Oracle-4.0.1-8i-py23-1.i386.rpm and converted it to > cx-oracle_4.0.1-2_i386.deb using Alient and installed it. No errors > appeared during the install. > > This is the result: > > 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 "<stdin>", line 1, in ? > ImportError: libclntsh.so.8.0: cannot open shared object file: No such > file or directory > >>> > > Any clues? > > Randall > It looks like you've started Python from a session where the Oracle libraries are not in the path. Make sure your PATH environment variable contains $ORACLE_HOME/bin and that your LD_LIBRARY_PATH environment variable contains $ORACLE_HOME/lib Of the two the second will fix your problem but the first is good practice and you should always set them as a pair. Regards, Andy -- -------------------------------------------------------------------------------- From the desk of Andrew J Todd esq - http://www.halfcooked.com/ |
From: Anthony T. <an...@co...> - 2004-05-25 19:05:13
|
Sounds to me like you're missing the Oracle client or it is not configured properly. Perform the following: ldd cx_Oracle.so and note the output. You may need to set the environment variable LD_LIBRARY_PATH to include $ORACLE_HOME/lib. Randall Smith wrote: > I installed the oracle client 8.1.7 on Debian SID. I have Python > version 2.3.3 installed. I downloaded > cx_Oracle-4.0.1-8i-py23-1.i386.rpm and converted it to > cx-oracle_4.0.1-2_i386.deb using Alient and installed it. No errors > appeared during the install. > > This is the result: > > 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 "<stdin>", line 1, in ? > ImportError: libclntsh.so.8.0: cannot open shared object file: No such > file or directory > >>> > > Any clues? > > Randall > > > ------------------------------------------------------- > This SF.Net email is sponsored by: Oracle 10g > Get certified on the hottest thing ever to hit the market... Oracle 10g. > Take an Oracle 10g class now, and we'll give you the exam FREE. > http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users |
From: Randall S. <ra...@tn...> - 2004-05-25 18:53:43
|
I installed the oracle client 8.1.7 on Debian SID. I have Python version 2.3.3 installed. I downloaded cx_Oracle-4.0.1-8i-py23-1.i386.rpm and converted it to cx-oracle_4.0.1-2_i386.deb using Alient and installed it. No errors appeared during the install. This is the result: 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 "<stdin>", line 1, in ? ImportError: libclntsh.so.8.0: cannot open shared object file: No such file or directory >>> Any clues? Randall |
From: <ben...@id...> - 2004-05-22 12:29:40
|
Dear Open Source developer I am doing a research project on "Fun and Software Development" in which I kindly invite you to participate. You will find the online survey under http://fasd.ethz.ch/qsf/. The questionnaire consists of 53 questions and you will need about 15 minutes to complete it. With the FASD project (Fun and Software Development) we want to define the motivational significance of fun when software developers decide to engage in Open Source projects. What is special about our research project is that a similar survey is planned with software developers in commercial firms. This procedure allows the immediate comparison between the involved individuals and the conditions of production of these two development models. Thus we hope to obtain substantial new insights to the phenomenon of Open Source Development. With many thanks for your participation, Benno Luthiger PS: The results of the survey will be published under http://www.isu.unizh.ch/fuehrung/blprojects/FASD/. We have set up the mailing list fa...@we... for this study. Please see http://fasd.ethz.ch/qsf/mailinglist_en.html for registration to this mailing list. _______________________________________________________________________ Benno Luthiger Swiss Federal Institute of Technology Zurich 8092 Zurich Mail: benno.luthiger(at)id.ethz.ch _______________________________________________________________________ |
From: Moore, P. <Pau...@at...> - 2004-05-20 13:49:38
|
Would it be possible to add a keyword parameter to makedsn, dedicated=3DTrue/False, which adds the (SERVER=3DDEDICATED) parameter to the generated connect string? In certain types of firewall environments (ie, ours :-() multithreaded connections won't get through the firewall, and the simplest answer is just to force SERVER=3DDEDICATED. It's easy enough to either generate my own connect string, or modify the generated one, but being able to say makedsn(host,port,sid,dedicated=3DTrue) would be a nice convenience. Thanks, Paul. _________________________________________________________________________= _ This e-mail and the documents attached are confidential and intended=20 solely for the addressee; it may also be privileged. If you receive this = e-mail in error, please notify the sender immediately and destroy it. As its integrity cannot be secured on the Internet, the Atos Origin = group=20 liability cannot be triggered for the message content. Although the=20 sender endeavours to maintain a computer virus-free network, the sender=20 does not warrant that this transmission is virus-free and will not be=20 liable for any damages resulting from any virus transmitted. _________________________________________________________________________= _ |
From: Anthony T. <an...@co...> - 2004-05-14 20:06:25
|
In the past couple of weeks I have had three people complain about the following behavior with respect to LOB variables: Imagine a table called "CLOBS" with a column "CLOBVAL" which has 25 rows in it and the programmer desires to get the values of the column to manipulate it in some way. The straightforward approach is to do the following: import cx_Oracle connection = cx_Oracle.connect("user/pw@tns") cursor = connection.cursor() cursor.execute("select clobval from clobs") for value, in cursor.fetchall(): print "Doing some manipulation with value", value.read() Unfortunately, the data returned will not match what is actually in the table. In the above case where the arraysize is unchanged from the default value of 1, the LOB value will always be equal to the last value actually fetched. This is not expected and results in a bug report to me. :-) The fact of the matter, however, is that it does make sense if you understand what is going on "underneath the covers" so to speak. Oracle uses LOB locators to allow you to access large objects and these must be allocated prior to any fetches. It would be unwise to allocate one of these "locators" for each row retrieved due to space and time considerations. However, it would be nice if this fact was made a little more obvious. :-) The proper code is as follows: import cx_Oracle connection = cx_Oracle.connect("user/pw@tns") cursor = connection.cursor() cursor.execute("select clobval from clobs") for value, in cursor: print "Doing some manipulation with value", value.read() This code works because the rows are fetched one at a time from the iterator. I am suggesting that the following changes be made: The documentation have the following lines added to the section on LOB variables: Internally, Oracle uses LOB locators which are allocated based on the cursor array size. Thus, it is important that the data in the LOB object be manipulated before another internal fetch takes place. The safest way to do this is to use the cursor as an iterator. The code be modified to raise a ProgrammingError when this situation is detected with the following text: "LOB variable no longer valid after subsequent fetch" Please comment! Anthony |
From: Anthony T. <an...@co...> - 2004-04-30 16:52:55
|
On Fri, 2004-04-30 at 10:41, 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 didn't prepare a test case because it is not part of the "standard" API for databases. I suppose I should rectify that at some point, in particular if people are going to actually use it... :-) As for sample code, I have code that is available publicly at http://starship.python.net/crew/atuining Within the package "cx_OracleTools" there is a script CopyData.py which uses all of the "advanced" techniques that cx_Oracle exports -- most of that code is for setting things up. The main loop at the end of the script is what is probably of greater interest to you. In addition, the package "cx_PyOracleLib" which "cx_OracleTools" depends on has another script cx_ImportData.py which might be a little simpler to peruse. If neither of those are helpful, you can always ask me and I'll see if I can explain it further. > 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. This is probably the best way. You can use the standard API to do all of this but I have noticed that there is a difference of 2 or even 3 to 1 using the advanced techniques. To put things in perspective, though, my machine was capable of inserting about 4,000 rows/second using the standard technique and about 10,000 rows/second using the advanced technique. For most people, 4,000 rows/second is probably adequate... :-) > Other suggestions? > > > TIA !!! > Steve Orr > > > ------------------------------------------------------- > This SF.Net email is sponsored by: Oracle 10g > Get certified on the hottest thing ever to hit the market... Oracle 10g. > Take an Oracle 10g class now, and we'll give you the exam FREE. > http://ads.osdn.com/?ad_id149&alloc_id66&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: Orr, S. <so...@ri...> - 2004-04-30 16:41:25
|
I don't see a test case on the executemanyprepared() function. Can someone give me some sample code to demonstrate how to use this?=20 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.=20 Other suggestions? TIA !!! Steve Orr |
From: Anthony T. <an...@co...> - 2004-04-27 21:44:28
|
Yes, you can. You need to use the constants LONG_STRING or LONG_BINARY instead of CLOB and BLOB or STRING and BINARY. The only real advantage to using CLOB and BLOB is that an empty_blob() can actually be passed; otherwise, Oracle will silent convert an empty string to a NULL value. :-) Hope that helps. On Tue, 2004-04-27 at 15:26, Jeff Wong wrote: > Hi, > > Is it possible to insert BLOBs using cx_Oracle 3.0? I have been able > to do it like this using cx_Oracle 4.0: > > v = cursor.var( cx_Oracle.BLOB, len( stuff )) > v.setvalue( 0, stuff ) > cursor.execute( "insert into blob_test values ( :blob ) ", {'blob', v } ) > > You can't do this in cx_Oracle 3.0 because the BLOB constant is not > defined. Using the BINARY constant doesn't work because I will get > complaints from setvalue about the string data being too large. (I am > inserting BLOBS of > greater than 4000 bytes.) > > I understand that I could upgrade but I'd like to avoid doing that if > possible. > > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: Oracle 10g > Get certified on the hottest thing ever to hit the market... Oracle 10g. > Take an Oracle 10g class now, and we'll give you the exam FREE. > http://ads.osdn.com/?ad_id=3149&alloc_id=8166&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: Jeff W. <jef...@sa...> - 2004-04-27 21:28:28
|
Oh, and TIA for any help. |
From: Jeff W. <jef...@sa...> - 2004-04-27 21:27:15
|
Hi, Is it possible to insert BLOBs using cx_Oracle 3.0? I have been able to do it like this using cx_Oracle 4.0: v = cursor.var( cx_Oracle.BLOB, len( stuff )) v.setvalue( 0, stuff ) cursor.execute( "insert into blob_test values ( :blob ) ", {'blob', v } ) You can't do this in cx_Oracle 3.0 because the BLOB constant is not defined. Using the BINARY constant doesn't work because I will get complaints from setvalue about the string data being too large. (I am inserting BLOBS of greater than 4000 bytes.) I understand that I could upgrade but I'd like to avoid doing that if possible. |
From: Anthony T. <an...@co...> - 2004-03-24 18:43:38
|
It looks to me like you're missing the xa.h include file. This seems to happen with default "client" installations of Oracle 8.1.x. It isn't exactly straightforward either how to get that file included in your installation so if you can't figure it out, let me know and I'll e-mail you a copy. On Wed, 2004-03-24 at 11:03, ra...@tn... wrote: > I'm trying to set cx_Oracle (latest version) up on Debian testing using > python2.3 and oracle 8.1.7. I'm getting errors as follows: > > oracle@DWSDELL2500:/home/randall/downloads/tarballs/cx_Oracle-4.0.1$ > python setu > p.py build > running build > running build_ext > building 'cx_Oracle' extension > gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall > -Wstrict-prototypes -fPI > C -I/opt/oracle/OraHome1/rdbms/demo -I/opt/oracle/OraHome1/rdbms/public > -I/opt/o > racle/OraHome1/network/public -I/usr/include/python2.3 -c cx_Oracle.c -o > build/t > emp.linux-i686-2.3/cx_Oracle.o -DBUILD_TIME="March 24, 2004 11:58:36" > In file included from /opt/oracle/OraHome1/rdbms/demo/oci.h:1648, > from cx_Oracle.c:9: > /opt/oracle/OraHome1/rdbms/demo/oci1.h:148: warning: function > declaration isn't > a prototype > In file included from /opt/oracle/OraHome1/rdbms/demo/oci.h:1673, > from cx_Oracle.c:9: > /opt/oracle/OraHome1/rdbms/demo/ociap.h:6271: warning: function > declaration isn' > t a prototype > /opt/oracle/OraHome1/rdbms/demo/ociap.h:8753: warning: function > declaration isn' > t a prototype > /opt/oracle/OraHome1/rdbms/demo/ociap.h:8759: warning: function > declaration isn' > t a prototype > cx_Oracle.c:10:16: xa.h: No such file or directory > In file included from Variable.c:85, > from Cursor.c:211, > from Connection.c:327, > from cx_Oracle.c:67: > NumberVar.c: In function `NumberVar_SetValue': > NumberVar.c:177: warning: passing arg 4 of `OCINumberFromText' discards > qualifie > rs from pointer target type > In file included from cx_Oracle.c:67: > Connection.c: In function `Connection_Begin': > Connection.c:655: error: `XID' undeclared (first use in this function) > Connection.c:655: error: (Each undeclared identifier is reported only > once > Connection.c:655: error: for each function it appears in.) > Connection.c:655: error: parse error before "xid" > Connection.c:663: error: `MAXGTRIDSIZE' undeclared (first use in this > function) > Connection.c:667: error: `MAXBQUALSIZE' undeclared (first use in this > function) > Connection.c:685: error: `xid' undeclared (first use in this function) > error: command 'gcc' failed with exit status 1 > > > Can you please tell me what is going wrong. I installed the oracle > client developer software. > > Randall > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&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: <ra...@tn...> - 2004-03-24 18:03:23
|
I'm trying to set cx_Oracle (latest version) up on Debian testing using python2.3 and oracle 8.1.7. I'm getting errors as follows: oracle@DWSDELL2500:/home/randall/downloads/tarballs/cx_Oracle-4.0.1$ python setu p.py build running build running build_ext building 'cx_Oracle' extension gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPI C -I/opt/oracle/OraHome1/rdbms/demo -I/opt/oracle/OraHome1/rdbms/public -I/opt/o racle/OraHome1/network/public -I/usr/include/python2.3 -c cx_Oracle.c -o build/t emp.linux-i686-2.3/cx_Oracle.o -DBUILD_TIME="March 24, 2004 11:58:36" In file included from /opt/oracle/OraHome1/rdbms/demo/oci.h:1648, from cx_Oracle.c:9: /opt/oracle/OraHome1/rdbms/demo/oci1.h:148: warning: function declaration isn't a prototype In file included from /opt/oracle/OraHome1/rdbms/demo/oci.h:1673, from cx_Oracle.c:9: /opt/oracle/OraHome1/rdbms/demo/ociap.h:6271: warning: function declaration isn' t a prototype /opt/oracle/OraHome1/rdbms/demo/ociap.h:8753: warning: function declaration isn' t a prototype /opt/oracle/OraHome1/rdbms/demo/ociap.h:8759: warning: function declaration isn' t a prototype cx_Oracle.c:10:16: xa.h: No such file or directory In file included from Variable.c:85, from Cursor.c:211, from Connection.c:327, from cx_Oracle.c:67: NumberVar.c: In function `NumberVar_SetValue': NumberVar.c:177: warning: passing arg 4 of `OCINumberFromText' discards qualifie rs from pointer target type In file included from cx_Oracle.c:67: Connection.c: In function `Connection_Begin': Connection.c:655: error: `XID' undeclared (first use in this function) Connection.c:655: error: (Each undeclared identifier is reported only once Connection.c:655: error: for each function it appears in.) Connection.c:655: error: parse error before "xid" Connection.c:663: error: `MAXGTRIDSIZE' undeclared (first use in this function) Connection.c:667: error: `MAXBQUALSIZE' undeclared (first use in this function) Connection.c:685: error: `xid' undeclared (first use in this function) error: command 'gcc' failed with exit status 1 Can you please tell me what is going wrong. I installed the oracle client developer software. Randall |
From: Anthony T. <an...@co...> - 2004-03-19 20:54:05
|
Sure, why not. :-) import cx_Oracle connection = cx_Oracle.connect("user/pw@tns") cursor = connection.cursor() clob = cursor.callfunc("dbms_metadata.get_ddl", cx_Oracle.CLOB, ("TABLE", "NODELINK")) print "Value is:", clob.read() Is that simple enough? :-) On Fri, 2004-03-19 at 13:03, Orr, Steve wrote: > I'm using the cool 9i dbms_metadata package from SQLPlus but can't > figure out how use it with cx_Oracle 4. Here's a clipping from a SQLPlus > session: > --------------------------------------------------------------------- > SQL> SELECT dbms_metadata.get_ddl('TABLE','NODELINK') from dual; > > CREATE TABLE "HYDRA"."NODELINK" > ( "ID" NUMBER, > "PARENTID" NUMBER, > "NODETEXT" VARCHAR2(252) > ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING > STORAGE(INITIAL 65536 NEXT 65536 MINEXTENTS 1 MAXEXTENTS 2147483645 > PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) > TABLESPACE "USERS" > --------------------------------------------------------------------- > > This returns the DDL for a database object as a CLOB. I've tried to use > the cx_Oracle lob.read() function in Python but can't seem to figure it > out. Can you provide some sample code on this? > > > TIA!! > Steve Orr -- 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: Orr, S. <so...@ri...> - 2004-03-19 20:04:05
|
I'm using the cool 9i dbms_metadata package from SQLPlus but can't figure out how use it with cx_Oracle 4. Here's a clipping from a SQLPlus session: --------------------------------------------------------------------- SQL> SELECT dbms_metadata.get_ddl('TABLE','NODELINK') from dual; CREATE TABLE "HYDRA"."NODELINK" ( "ID" NUMBER, "PARENTID" NUMBER, "NODETEXT" VARCHAR2(252) ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE(INITIAL 65536 NEXT 65536 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "USERS" --------------------------------------------------------------------- This returns the DDL for a database object as a CLOB. I've tried to use the cx_Oracle lob.read() function in Python but can't seem to figure it out. Can you provide some sample code on this? TIA!! Steve Orr |
From: Anthony T. <an...@co...> - 2004-03-17 22:06:21
|
On Wed, 2004-03-17 at 14:11, Paul Moore wrote: > Anthony Tuininga <an...@co...> writes: > > > There is no way in the OCI that I am aware of for dealing with timeouts. > > [...] > > > The only other option (that I can think of) is to use threads or > > processes and a timer to implement your own timeout of some sort -- > > not a very palatable option, though. :-) > > Thanks for the information. I was afraid that was the case. Threads is > a possibility (I'm running 50 or more connect attempts in separate > threads, so adding a control thread isn't much of a problem). But that > still leaves the question - if thread A is sitting in a connect() > call, can I, from thread B, make it stop? (Given that Python offers no > way to kill a thread from "outside"). No. The connect attempt will simply continue and fail (or succeed) whenever it gets around to it. Its just that the program no longer cares about the result. :-) Oracle provides a method for canceling statement executions (on all platforms except Windows) but nothing for making connections. That's just the way it is, unfortunately. > Thanks, > 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: Paul M. <pf_...@ya...> - 2004-03-17 21:11:05
|
Anthony Tuininga <an...@co...> writes: > There is no way in the OCI that I am aware of for dealing with timeouts. [...] > The only other option (that I can think of) is to use threads or > processes and a timer to implement your own timeout of some sort -- > not a very palatable option, though. :-) Thanks for the information. I was afraid that was the case. Threads is a possibility (I'm running 50 or more connect attempts in separate threads, so adding a control thread isn't much of a problem). But that still leaves the question - if thread A is sitting in a connect() call, can I, from thread B, make it stop? (Given that Python offers no way to kill a thread from "outside"). Thanks, Paul. -- This signature intentionally left blank |
From: Anthony T. <an...@co...> - 2004-03-17 19:27:35
|
There is no way in the OCI that I am aware of for dealing with timeouts. There may be something available in SQL*Net (sqlnet.ora) that would deal with this -- in fact I am fairly certain there is but never having used it I wouldn't know for certain. A quick scan of the sample sqlnet.ora that ships with Oracle 9i shows a value sqlnet.inbound_connect_timeout which may do what you want. The only other option (that I can think of) is to use threads or processes and a timer to implement your own timeout of some sort -- not a very palatable option, though. :-) On Wed, 2004-03-17 at 11:30, Paul Moore wrote: > Is it possible to force a timeout on a cx_Oracle.connect? I have a job > which connects to a number of databases, but occasionally one of the > connections hangs. I'm not sure why, it may be a network problem or > something, but I can't find a way of stopping it. > > To avoid the whole job hanging, I'd like to be able to specify a > timeout on the connection attempt. I've checked the cx_Oracle > documentation, and what I can of the Oracle documentation (I know very > little of how OCI works) but I can't see a way of doing this. > > Is it possible? > > Thanks, > 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: Paul M. <pf_...@ya...> - 2004-03-17 18:41:04
|
Is it possible to force a timeout on a cx_Oracle.connect? I have a job which connects to a number of databases, but occasionally one of the connections hangs. I'm not sure why, it may be a network problem or something, but I can't find a way of stopping it. To avoid the whole job hanging, I'd like to be able to specify a timeout on the connection attempt. I've checked the cx_Oracle documentation, and what I can of the Oracle documentation (I know very little of how OCI works) but I can't see a way of doing this. Is it possible? Thanks, Paul. -- This signature intentionally left blank |
From: Anthony T. <an...@co...> - 2004-03-03 15:35:38
|
On Wed, 2004-03-03 at 04:28, Danny R. Boxhoorn wrote: > There are many reason to switch from DCOracle2 to cx_Oracle and there are a > few that keep me from switching. > The most important one is that lack of support for positional parameters. > I.e., you cannot do something like > > cursor.execute('select 4 from dual where :1 > 1', 37) > > which DCOracle2 allows you to do. > A workaround is to use named parameters and replace all the occurrences of > :<n> with :p<n> in queries. Given the heavy use of positional parameters in the code I have I would like to avoid rewriting it. > So the questions are: > Is support for positional parameters planned? Yes. Interestingly enough I have had some discussions with another person off the list regarding this very same thing. I ran a few tests and creating lists is twice as fast as creating dictionaries so performance wise it is a worthwhile addition. Besides which, sometimes it is quite convenient to be able to use positional parameters, such as in callproc() and callfunc() where currently I have to transform the list into a dictionary in order to call execute(). So yes, I was leaning towards adding this in 4.1. > How much work would be needed to support positional parameters? That depends on the answers to a couple of questions. In the above code you specify a parameter not inside a list. Does that mean DCOracle2 has the following syntax (Python equivalent) def execute(sql, *args) # where args is all positional parameters OR def execute(sql, args) # where args is a list I personally prefer the first but the DB API indicates that the latter is a requirement. If I continue to use the latter, then all I have to do is check to see if the arguments passed are a list or a dictionary and act accordingly. The rest is fairly straightforward. If you were hoping for the former, then I'd like some answers as to how to make it compatible with the DB API. One possibility is to check to see if only one parameter is passed and if it is a list of dictionary, do the DB API thing; otherwise, take the entire list and pass it through as positional parameters. It smacks of hacking but I can't thing of anything else. Any ideas? BTW, does DCOracle2 supported named parameters as well? Do you know or should I just go look at the source and see what they do? :-) > Another question is about object REFerences. It would be nice if they > would be supported. DCOracle2 support for them is limited to `Segmentation > Fault'. I already had a look and I think I could add support for REF's > myself. But before I do that I would like to know whether that's appreciated > and, more importantly, needed ... is support for REF's planned? [) I have never had occasion to use Oracle "objects" (named types) so I haven't bothered adding support. I don't see that changing soon so although I would be interested in having support added, it isn't high on my priority list at the moment. If you are willing to provide patches, I am willing to add them and I would be very appreciative. :-) > Finally, what about the new BINARY_FLOAT and BINARY_DOUBLE types in 10g. > They are high on my wishlist and I can imagine it's trivial to add support > for them. Again, is this planned? I have just barely looked at 10g so I hadn't really planned anything on that front yet. I know that cx_Oracle compiles and passes the test suite on 10g on Linux but nothing more than that yet. Still, I do remember reading about these in the release notes and I can't see that they would be a problem. So yes, I will definitely add these as soon as I can get some more time to play with 10g. > Thanks for the hard work and the prompt and polite response, You're welcome. > Danny R. Boxhoorn > > Kapteyn Institute / OmegaCEN e-mail: da...@as... > Postbus 800 tel.: +31 (0)50 3634056 > 9700 AV GRONINGEN fax.: +31 (0)50 3636100 > THE NETHERLANDS http://www.astro.rug.nl/omegacen > > > ------------------------------------------------------- > 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: Danny R. B. <da...@as...> - 2004-03-03 11:42:21
|
There are many reason to switch from DCOracle2 to cx_Oracle and there are a few that keep me from switching. The most important one is that lack of support for positional parameters. I.e., you cannot do something like cursor.execute('select 4 from dual where :1 > 1', 37) which DCOracle2 allows you to do. A workaround is to use named parameters and replace all the occurrences of :<n> with :p<n> in queries. Given the heavy use of positional parameters in the code I have I would like to avoid rewriting it. So the questions are: Is support for positional parameters planned? How much work would be needed to support positional parameters? Another question is about object REFerences. It would be nice if they would be supported. DCOracle2 support for them is limited to `Segmentation Fault'. I already had a look and I think I could add support for REF's myself. But before I do that I would like to know whether that's appreciated and, more importantly, needed ... is support for REF's planned? [) Finally, what about the new BINARY_FLOAT and BINARY_DOUBLE types in 10g. They are high on my wishlist and I can imagine it's trivial to add support for them. Again, is this planned? Thanks for the hard work and the prompt and polite response, Danny R. Boxhoorn Kapteyn Institute / OmegaCEN e-mail: da...@as... Postbus 800 tel.: +31 (0)50 3634056 9700 AV GRONINGEN fax.: +31 (0)50 3636100 THE NETHERLANDS http://www.astro.rug.nl/omegacen |
From: Anthony T. <tui...@sh...> - 2004-02-28 06:39:04
|
What is cx_Oracle? cx_Oracle is a Python extension module that allows access to Oracle and conforms to the Python database API 2.0 specifications with a few exceptions. Where do I get it? http://starship.python.net/crew/atuining http://www.computronix.com/utilities.shtml (it may be a few days before the second site is updated) What's new? 1) Fixed bugs on 64-bit platforms that caused segmentation faults and bus errors in session pooling and determining the bind variables associated with a statement. 2) Modified test suite so that 64-bit platforms are tested properly. 3) Added missing commit statements in the test setup scripts. Thanks to Keith Lyon for pointing this out. 4) Fix setup.py for Cygwin environments. Thanks to Doug Henderson for providing the necessary fix. 5) Added support for compiling cx_Oracle without thread support. Thanks to Andre Reitz for pointing this out. 6) Added support for a new keyword parameter called threaded on connections and session pools. This parameter defaults to False and indicates whether threaded mode ought to be used. It replaces the module level attribute OPT_Threading although examining the attribute will be retained until the next release at least. 7) Added support for a new keyword parameter called twophase on connections. This parameter defaults to False and indicates whether support for two phase (distributed or global) transactions ought to be present. Note that support for distributed transactions is buggy when crossing major version boundaries (Oracle 8i to Oracle 9i for example). 8) Ensure that the rowcount attribute is set properly when an exception is raised during execution. Thanks to Gary Aviv for pointing out this problem and its solution. Just as a side note, I have also built and tested cx_Oracle under Oracle 10g on Linux and it works correctly without changes. Oracle 10g has not yet been released for Windows but it will be tested on that platform as well when it becomes available. -- 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-27 15:16:42
|
Selecting from dual has solved my problem.=20 With this is sufficient... :-) A lot of thanks. El Vie 27 Feb 2004 15:59, Anthony Tuininga escribi=F3: > 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 i= f > 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 y= ou > > 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, 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=3Dick > > _______________________________________________ > > 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=3D1356&alloc_id=3D3438&op=3Dclick > > _______________________________________________ > > cx-oracle-users mailing list > > cx-...@li... > > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users |