cx-oracle-users Mailing List for cx_Oracle (Page 143)
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-09-01 16:35:41
|
Version 4.0 and up handle both binding and fetching of long integers properly, I believe -- there are test cases that ensure this fact. Could you tell us which version of cx_Oracle you are using? Thanks. D.R. Boxhoorn wrote: > Hoi Guido, > > All I can say is that the following works fine for me > > % python > Python 2.3.3 (#1, May 24 2004, 12:04:05) > [GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-24)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> import cx_Oracle as odbc > >>> > >>> print odbc.version > 4.0.1 > >>> > >>> database = odbc.connect('ops$danny','ez','awtst.omegatest.nova.aw') > >>> cursor = database.cursor() > >>> cursor.execute('select 1234567800000001 from dual where 1234567800000001=:a',a=1234567800000001L) > [<NumberVar object at 0xb72f01d0>] > >>> print cursor.fetchall() > [(1234567800000001L,)] > >>> cursor.close() > > Both binding and fetching seems to be ok, so it looks like a more complex > example is needed to expose your colleagues problem. > > Cheers, > > Danny > > 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-wise.org/ > > > On Wed, Sep 01, 2004 at 07:10:22AM -0700, Guido van Rossum wrote: > >>A certain table in our Oracle database contains 16-digit integers. >>These are a bit of a pain to get right at the best of times, but "set >>numformat 9999999999999999" makes it work in SQL*Plus. Now my colleague >>is complaining that when using cx_Oracle, the values come back with the >>lower digit(s?) truncated, as if they have somehow been converted to a >>floating point type and back that doesn't have enough bits. This seems >>strange to me, since an IEEE float *does* have enough bits for the >>values, and Python has no trouble with these at all. What are we >>missing? (A sample value is 1234567800000001.) >> >>--Guido van Rossum (home page: http://www.python.org/~guido) >> >> >>------------------------------------------------------- >>This SF.Net email is sponsored by BEA Weblogic Workshop >>FREE Java Enterprise J2EE developer tools! >>Get your free copy of BEA WebLogic Workshop 8.1 today. >>http://ads.osdn.com/?ad_idP47&alloc_id808&op?k >>_______________________________________________ >>cx-oracle-users mailing list >>cx-...@li... >>https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > > > > ------------------------------------------------------- > This SF.Net email is sponsored by BEA Weblogic Workshop > FREE Java Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 today. > http://ads.osdn.com/?ad_idP47&alloc_id808&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: Anthony T. <an...@co...> - 2004-09-01 16:28:15
|
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 What's new? 1) Added support for Python 2.4. In Python 2.4, the datetime module is used for both binding and fetching of date and timestamp data. In Python 2.3, objects from the datetime module can be bound but the This is internal datetime objects will be returned from queries. 2) Added pickling support for LOB and datetime data. 3) Fully qualified the table name that was missing in an alter table statement in the setup test script as noted by Marc Gehling. 4) Added a section allowing for the setting of the RPATH linker directive in setup.py as requested by Iustin Pop. 5) Added code to raise a programming error exception when an attempt is made to access a LOB locator variable in a subsequent fetch. 6) The username, password and dsn (tnsentry) are stored on the connection object when specified, regardless of whether or not a standard connection takes place. 7) Added additional module level constant called "LOB" as requested by Joseph Canedo. 8) Changed exception type to IntegrityError for constraint violations as requested by Joseph Canedo. 9) If scale and precision are not specified, an attempt is made to return a long integer as requested by Joseph Canedo. 10) Added workaround for Oracle bug which returns an invalid handle when the prepare call fails. Thanks to al...@hs... for providing the code that demonstrated the problem. 11) The cusor method arravar() will now accept the actual list so that it is not necessary to call cursor.arrayvar() followed immediately by var.setvalue(). 12) Fixed bug where attempts to execute the statement "None" with bind variables would cause a segmentation fault. 13) Added support for binding by position (paramstyle = "numeric"). 14) Removed memory leak created by calls to OCIParamGet() which were not mirrored by calls to OCIDescriptorFree(). Thanks to Mihai Ibanescu for pointing this out and providing a patch. 15) Added support for calling cursor.executemany() with statement None implying that the previously prepared statement ought to be executed. Thanks to Mihai Ibanescu for providing a patch. 16) Added support for rebinding variables when a subsequent call to cursor.executemany() uses a different number of rows. Thanks to Mihai Ibanescu for supplying a patch. 17) The microseconds are now displayed in datetime variables when nonzero similar to method used in the datetime module. 18) Added support for binary_float and binary_double columns in Oracle 10g. -- 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: D.R. B. <da...@as...> - 2004-09-01 15:21:26
|
Hoi Guido, All I can say is that the following works fine for me % python Python 2.3.3 (#1, May 24 2004, 12:04:05) [GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-24)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import cx_Oracle as odbc >>> >>> print odbc.version 4.0.1 >>> >>> database =3D odbc.connect('ops$danny','ez','awtst.omegatest.nova.aw') >>> cursor =3D database.cursor() >>> cursor.execute('select 1234567800000001 from dual where 123456780000= 0001=3D:a',a=3D1234567800000001L) [<NumberVar object at 0xb72f01d0>] >>> print cursor.fetchall() [(1234567800000001L,)] >>> cursor.close() Both binding and fetching seems to be ok, so it looks like a more complex example is needed to expose your colleagues problem. Cheers, Danny 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-wise.org/ On Wed, Sep 01, 2004 at 07:10:22AM -0700, Guido van Rossum wrote: > A certain table in our Oracle database contains 16-digit integers. > These are a bit of a pain to get right at the best of times, but "set > numformat 9999999999999999" makes it work in SQL*Plus. Now my colleague > is complaining that when using cx_Oracle, the values come back with the > lower digit(s?) truncated, as if they have somehow been converted to a > floating point type and back that doesn't have enough bits. This seems > strange to me, since an IEEE float *does* have enough bits for the > values, and Python has no trouble with these at all. What are we > missing? (A sample value is 1234567800000001.) >=20 > --Guido van Rossum (home page: http://www.python.org/~guido) >=20 >=20 > ------------------------------------------------------- > This SF.Net email is sponsored by BEA Weblogic Workshop > FREE Java Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 today. > http://ads.osdn.com/?ad_idP47&alloc_id=10808&op?k > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users |
From: Guido v. R. <gu...@el...> - 2004-09-01 14:10:27
|
A certain table in our Oracle database contains 16-digit integers. These are a bit of a pain to get right at the best of times, but "set numformat 9999999999999999" makes it work in SQL*Plus. Now my colleague is complaining that when using cx_Oracle, the values come back with the lower digit(s?) truncated, as if they have somehow been converted to a floating point type and back that doesn't have enough bits. This seems strange to me, since an IEEE float *does* have enough bits for the values, and Python has no trouble with these at all. What are we missing? (A sample value is 1234567800000001.) --Guido van Rossum (home page: http://www.python.org/~guido) |
From: Michael M. <mi...@ma...> - 2004-08-18 10:51:38
|
Hi On 21 Jul 2004, at 21:58, Anthony Tuininga wrote: > You'll need to provide more information. Specifically what Oracle > __client__ software you are using and what version of cx_Oracle you > are using. In addition, could you try making the connection using a > tns entry from a tnsnames.ora file or something equivalent? That might > be the source of the issue as well. > Just back from a holiday - sorry for the delay in replying. Here is the extra information, Client version Release 9.2.0.1.0 - Developer's Release cx_Oracle version 4.0.1 I'll try to make the connection using the tns entry also - although the connection and query run fine as long as I don't try to get the clob using python - If I use to_char() to return a string instead it works fine. thanks Michael > Michael Maibaum wrote: > >> Hi, >> >> I'm rather new to Python so please excuse any mind blowingly dumb >> errors below.... >> >> I'm trying to write a script to download and format data from Oracle >> one column of which is a CLOB. I've hit a problem with my script >> shown with the minimal test case below >> >> >> Mac OS X 10.3.4, >> python 2.3.4 (non-framework build (as cx_Oracle didn't build against >> the framework one...) ) >> connecting to 9i on Solaris >> >> (password and host information removed..) >> >> ###### >> #!/opt/local/bin/python >> >> import cx_Oracle >> >> user = 'mike' >> password = '...' >> sid = '.....' >> host = '....' >> port = 1521 >> >> dsn = cx_Oracle.makedsn(host,port,sid) >> connect = cx_Oracle.connect(user,pass,dsn) >> cursor = connect.cursor() >> >> cursor.execute("select aa_seq from gene3d_admin.g3d_seq") >> >> for value, in cursor: >> value.read() >> >> ##### >> >> Traceback (most recent call last): >> File "test.py", line 19, in ? >> value.read() >> cx_Oracle.InternalError: No Oracle error? >> >> I can get the non-CLOB columns with no problem. I'm confident I'm >> doing something dumb but extensive googling hasn't helped... any >> ideas? >> > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by BEA Weblogic Workshop > FREE Java Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 today. > http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > |
From: Anthony T. <an...@co...> - 2004-08-16 21:02:35
|
Apologies for the delay. I was going through all of my e-mail from my holiday and came across this one. :-) Currently this is the only way of extracting that data. The datetime module checks to see if the fractional seconds are zero and if so does not display the fractional seconds; otherwise it does. I could do the same thing if that makes sense. BTW, your implementation should probably use something like "%s.%.6d" or something similar so that the fractional seconds portion is zero filled. Chris Dunscombe wrote: > Anthony, > > Thanks for that, I can now get the fsecond data. > Is there another way to get the full timestamp data, as a string, apart from: > > fullTimestamp = str(timestampCol) + "." + str(timestampCol.fsecond) > where timestampCol is a > TimestampVar object returned from a cursor. > > Thanks, > > Chris > > PS This can wait so enjoy your holiday > > > > > --- Anthony Tuininga <an...@co...> wrote: > >>The __str__ method for the timestamp implementation of cx_Oracle does >>not include the fractional seconds. That doesn't mean that they are not >>actually there -- they are. Take a look at the documentation for the >>date object and you will see what I mean. I'd give you the information >>myself but right now I am on vacation and have limited access to a computer. >> >>Chris Dunscombe wrote: >> >> >>>Hi, >>> >>>I'm unable to get cx_Oracle to fully display an Oracle 9i Timestamp column: >>> >>> >>> >>>>>>cur = db.cursor() >>>>>>cur.execute("select order_date from oe.orders where rownum < 2") >>> >>>[<TimestampVar object at 0x007EB260>] >>> >>> >>>>>>print cur.description >>> >>>[('ORDER_DATE', <type 'TimestampVar'>, -1, 11, 0, 0, 0)] >>> >>> >>>>>>data = cur.fetchall() >>>>>>print data[0][0] >>> >>>1999-08-16 22:34:12 >>> >>> >>>>>>type(data[0][0]) >>> >>><type 'ExternalDateTimeVar'> >>> >>>As you can see the fractions of second aren't being displayed. >>> >>>Maybe there's a clue in that the column is actually being returned into an ExternalDateTimeVar >>>type not a TimestampVar defined by the cursor. This could easily be me jumping to conclusions. >>> >>>I'm running 4.0.1 on a 9.2 client on Windows against a 9.2.0.4 database on Linux. >>> >>>Thanks, >>> >>>Chris Dunscombe >>> >>>Reg >>> >>> >>> >>> >>>__________________________________ >>>Do you Yahoo!? >>>Yahoo! Mail - 50x more storage than other providers! >>>http://promotions.yahoo.com/new_mail >>> >>> >>>------------------------------------------------------- >>>This SF.Net email is sponsored by BEA Weblogic Workshop >>>FREE Java Enterprise J2EE developer tools! >>>Get your free copy of BEA WebLogic Workshop 8.1 today. >>>http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click >>>_______________________________________________ >>>cx-oracle-users mailing list >>>cx-...@li... >>>https://lists.sourceforge.net/lists/listinfo/cx-oracle-users >> >> > > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com -- 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...> - 2004-07-31 21:00:25
|
You are compiling DCOracle2, right? If so, you've come to the wrong list... :-) I think the Zope guys deal with this stuff so you can ask them about these problems. I can give you a hint about the problem, though. The last error is simply telling you that it can't find the symbols referenced in the C source. From experience they are the Python libraries and the OCI (Oracle) libraries. BUT, the removal of the -c option is the real problem since clearly the Makefile is trying to simply compile the source into an object file for __later__ linking. I'm not sure what the @DEFS@ is for but I would guess that autoconf was supposed to replace that with something real. Good question on that one, though. Try removing the @DEFS@ from the original command line and see if that solves your problem. Anything else though should go to somewhere else. Now if you want to try cx_Oracle and you run into troubles there, I'd be more than happy to help! :-) Martinez, Michael wrote: > The following compile errors on Redhat Linux ES 2.1, Python 2.3.4, > Oracle 9.2.0.2: > > First error: > > ---------- > > make[1]: Entering directory `/usr/local/zope/DCOracle2/src' > > gcc -pthread -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/include/python2.3 -I/usr/local/include/python2.3 @DEFS@ > -I/home/oracle/app/oracle/product/9.2.0/rdbms/demo > -I/home/oracle/app/oracle/product/9.2.0/network/public > -I/home/oracle/app/oracle/product/9.2.0/plsql/public > -I/home/oracle/app/oracle/product/9.2.0/rdbms/public -DORACLE9i -c > ././dco2.c -o ./dco2.o > > gcc: cannot specify -o with -c or -S and multiple compilations > > make[1]: *** [dco2.o] Error 1 > > When I remove “-c” from src/Makefile, this error is fixed. The compile > continue until the next error: > > Second error; > > /home/oracle/app/oracle/product/9.2.0/rdbms/demo/ociap.h:9796: > warning: function declaration isn't a prototype > > make[1]: *** [dco2.o] Error 1 > > There’s a bunch of “warnings” preceding this error, but there’s no > compile “errors.” Also gcc warns that there is no such file or > directory called “@DEFS@”. > > If I remove “@DEFS@” from the gcc command line options, the compile > continues until the third error: > > Third error: > > Bunch of undefined references: > > /tmp/ccmT96G1.o: In function `Cursor_bindbyname': > > /usr/local/zope/DCOracle2/src/././dco2.c:3435: undefined reference to > `PyArg_ParseTuple' > > /usr/local/zope/DCOracle2/src/././dco2.c:3450: undefined reference to > `PyExc_ValueError' > > /usr/local/zope/DCOracle2/src/././dco2.c:3450: undefined reference to > `PyErr_SetString' > > /tmp/ccmT96G1.o: In function `Cursor_getdesc': > > /usr/local/zope/DCOracle2/src/././dco2.c:3488: undefined reference to > `Py_BuildValue' > > /usr/local/zope/DCOracle2/src/././dco2.c:3494: undefined reference to > `OCIParamGet' > > /usr/local/zope/DCOracle2/src/././dco2.c:3504: undefined reference to > `OCIAttrGet' > > Anyone know how to fix these? > > Mike > > Michael Martinez > > Unix System Administrator > > ISTM/CSREES/USDA Room 4161 > > Washington, DC 2004 > > Phone: (202) 720-6223 > > Email: mma...@cs... <mailto:mma...@cs...> > |
From: Chris D. <cdu...@ya...> - 2004-07-26 16:33:47
|
Anthony, Thanks for that, I can now get the fsecond data. Is there another way to get the full timestamp data, as a string, apart from: fullTimestamp = str(timestampCol) + "." + str(timestampCol.fsecond) where timestampCol is a TimestampVar object returned from a cursor. Thanks, Chris PS This can wait so enjoy your holiday --- Anthony Tuininga <an...@co...> wrote: > The __str__ method for the timestamp implementation of cx_Oracle does > not include the fractional seconds. That doesn't mean that they are not > actually there -- they are. Take a look at the documentation for the > date object and you will see what I mean. I'd give you the information > myself but right now I am on vacation and have limited access to a computer. > > Chris Dunscombe wrote: > > > Hi, > > > > I'm unable to get cx_Oracle to fully display an Oracle 9i Timestamp column: > > > > > >>>>cur = db.cursor() > >>>>cur.execute("select order_date from oe.orders where rownum < 2") > > > > [<TimestampVar object at 0x007EB260>] > > > >>>>print cur.description > > > > [('ORDER_DATE', <type 'TimestampVar'>, -1, 11, 0, 0, 0)] > > > >>>>data = cur.fetchall() > >>>>print data[0][0] > > > > 1999-08-16 22:34:12 > > > >>>>type(data[0][0]) > > > > <type 'ExternalDateTimeVar'> > > > > As you can see the fractions of second aren't being displayed. > > > > Maybe there's a clue in that the column is actually being returned into an ExternalDateTimeVar > > type not a TimestampVar defined by the cursor. This could easily be me jumping to conclusions. > > > > I'm running 4.0.1 on a 9.2 client on Windows against a 9.2.0.4 database on Linux. > > > > Thanks, > > > > Chris Dunscombe > > > > Reg > > > > > > > > > > __________________________________ > > Do you Yahoo!? > > Yahoo! Mail - 50x more storage than other providers! > > http://promotions.yahoo.com/new_mail > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by BEA Weblogic Workshop > > FREE Java Enterprise J2EE developer tools! > > Get your free copy of BEA WebLogic Workshop 8.1 today. > > http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click > > _______________________________________________ > > cx-oracle-users mailing list > > cx-...@li... > > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
From: <wa...@li...> - 2004-07-26 11:10:24
|
Anthony Tuininga wrote: > I am on vacation right now so I can't test this myself. Perhaps you > could try it with the shipping cx_Oracle as well? I reinstalled the release version of cx_Oracle 4.0.1 and it still gives me a segmentation fault. > Just before I left on > vacation I received an e-mail from someone with respect to the patch you > mention -- I am thinking of reversing it as a result of that e-mail as > it turns out that the problem is an Oracle bug Do we have any change of getting this bug fixed? > and the issues I > discussed with you (about unicode and the like) are much worse than I > imagined. I'll get back to you with some more information when I return > (first week of August). OK! Bye, Walter Dörwald |
From: Martinez, M. <MMA...@CS...> - 2004-07-22 15:56:09
|
The following compile errors on Redhat Linux ES 2.1, Python 2.3.4, Oracle 9.2.0.2: =20 First error:=20 ---------- make[1]: Entering directory `/usr/local/zope/DCOracle2/src' gcc -pthread -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I/usr/local/include/python2.3 -I/usr/local/include/python2.3 @DEFS@ -I/home/oracle/app/oracle/product/9.2.0/rdbms/demo -I/home/oracle/app/oracle/product/9.2.0/network/public -I/home/oracle/app/oracle/product/9.2.0/plsql/public -I/home/oracle/app/oracle/product/9.2.0/rdbms/public -DORACLE9i -c ././dco2.c -o ./dco2.o gcc: cannot specify -o with -c or -S and multiple compilations make[1]: *** [dco2.o] Error 1 =20 When I remove "-c" from src/Makefile, this error is fixed. The compile continue until the next error: =20 Second error; /home/oracle/app/oracle/product/9.2.0/rdbms/demo/ociap.h:9796: warning: function declaration isn't a prototype make[1]: *** [dco2.o] Error 1 =20 There's a bunch of "warnings" preceding this error, but there's no compile "errors." Also gcc warns that there is no such file or directory called "@DEFS@". =20 If I remove "@DEFS@" from the gcc command line options, the compile continues until the third error: =20 Third error: Bunch of undefined references: =20 /tmp/ccmT96G1.o: In function `Cursor_bindbyname': /usr/local/zope/DCOracle2/src/././dco2.c:3435: undefined reference to `PyArg_ParseTuple' /usr/local/zope/DCOracle2/src/././dco2.c:3450: undefined reference to `PyExc_ValueError' /usr/local/zope/DCOracle2/src/././dco2.c:3450: undefined reference to `PyErr_SetString' /tmp/ccmT96G1.o: In function `Cursor_getdesc': /usr/local/zope/DCOracle2/src/././dco2.c:3488: undefined reference to `Py_BuildValue' /usr/local/zope/DCOracle2/src/././dco2.c:3494: undefined reference to `OCIParamGet' /usr/local/zope/DCOracle2/src/././dco2.c:3504: undefined reference to `OCIAttrGet' =20 =20 Anyone know how to fix these? =20 Mike =20 =20 Michael Martinez Unix System Administrator ISTM/CSREES/USDA Room 4161 Washington, DC 2004 Phone: (202) 720-6223 Email: mma...@cs... =20 |
From: Anthony T. <an...@co...> - 2004-07-22 14:23:36
|
I am on vacation right now so I can't test this myself. Perhaps you could try it with the shipping cx_Oracle as well? Just before I left on vacation I received an e-mail from someone with respect to the patch you mention -- I am thinking of reversing it as a result of that e-mail as it turns out that the problem is an Oracle bug and the issues I discussed with you (about unicode and the like) are much worse than I imagined. I'll get back to you with some more information when I return (first week of August). Walter Dörwald wrote: > I'm having problems with implementing custom cursors. > A minimal failing example is this: > > from cx_Oracle import * > > class Cursor2(Cursor): > pass > > class Connection2(Connection): > def cursor(self): > return Cursor2() > > db = Connection2("...") > c = db.cursor() > > Executing this gives me a Segmentation fault. I'm on Linux using > cx_Oracle 4.0.1 with Anthony's patch for the NVARCHAR/UTF16 problem. > > Bye, > Walter Dörwald > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by BEA Weblogic Workshop > FREE Java Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 today. > http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users |
From: Anthony T. <an...@co...> - 2004-07-22 14:17:19
|
The __str__ method for the timestamp implementation of cx_Oracle does not include the fractional seconds. That doesn't mean that they are not actually there -- they are. Take a look at the documentation for the date object and you will see what I mean. I'd give you the information myself but right now I am on vacation and have limited access to a computer. Chris Dunscombe wrote: > Hi, > > I'm unable to get cx_Oracle to fully display an Oracle 9i Timestamp column: > > >>>>cur = db.cursor() >>>>cur.execute("select order_date from oe.orders where rownum < 2") > > [<TimestampVar object at 0x007EB260>] > >>>>print cur.description > > [('ORDER_DATE', <type 'TimestampVar'>, -1, 11, 0, 0, 0)] > >>>>data = cur.fetchall() >>>>print data[0][0] > > 1999-08-16 22:34:12 > >>>>type(data[0][0]) > > <type 'ExternalDateTimeVar'> > > As you can see the fractions of second aren't being displayed. > > Maybe there's a clue in that the column is actually being returned into an ExternalDateTimeVar > type not a TimestampVar defined by the cursor. This could easily be me jumping to conclusions. > > I'm running 4.0.1 on a 9.2 client on Windows against a 9.2.0.4 database on Linux. > > Thanks, > > Chris Dunscombe > > Reg > > > > > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 50x more storage than other providers! > http://promotions.yahoo.com/new_mail > > > ------------------------------------------------------- > This SF.Net email is sponsored by BEA Weblogic Workshop > FREE Java Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 today. > http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users |
From: <wa...@li...> - 2004-07-22 10:32:40
|
I'm having problems with implementing custom cursors. A minimal failing example is this: from cx_Oracle import * class Cursor2(Cursor): pass class Connection2(Connection): def cursor(self): return Cursor2() db = Connection2("...") c = db.cursor() Executing this gives me a Segmentation fault. I'm on Linux using cx_Oracle 4.0.1 with Anthony's patch for the NVARCHAR/UTF16 problem. Bye, Walter Dörwald |
From: Anthony T. <an...@co...> - 2004-07-21 20:58:38
|
You'll need to provide more information. Specifically what Oracle __client__ software you are using and what version of cx_Oracle you are using. In addition, could you try making the connection using a tns entry from a tnsnames.ora file or something equivalent? That might be the source of the issue as well. Michael Maibaum wrote: >Hi, > >I'm rather new to Python so please excuse any mind blowingly dumb >errors below.... > >I'm trying to write a script to download and format data from Oracle >one column of which is a CLOB. I've hit a problem with my script shown >with the minimal test case below > > >Mac OS X 10.3.4, >python 2.3.4 (non-framework build (as cx_Oracle didn't build against >the framework one...) >connecting to 9i on Solaris) > >(password and host information removed..) > >###### >#!/opt/local/bin/python > >import cx_Oracle > >user = 'mike' >password = '...' >sid = '.....' >host = '....' >port = 1521 > >dsn = cx_Oracle.makedsn(host,port,sid) >connect = cx_Oracle.connect(user,pass,dsn) >cursor = connect.cursor() > >cursor.execute("select aa_seq from gene3d_admin.g3d_seq") > >for value, in cursor: > value.read() > >##### > >Traceback (most recent call last): > File "test.py", line 19, in ? > value.read() >cx_Oracle.InternalError: No Oracle error? > >I can get the non-CLOB columns with no problem. I'm confident I'm doing >something dumb but extensive googling hasn't helped... any ideas? > > |
From: Anthony T. <an...@co...> - 2004-07-21 20:53:57
|
The reason for the default being 1 is the DB API states that it ought to be and its safest -- since the use of long and long raw columns can quickly blow your available memory away! The simplest way to override the default is to do the following: class MyConnection(cx_Oracle.Connection): def cursor(self): cursor = super(MyConnection, self).cursor() cursor.arraysize = 1000 return cursor Hope that helps. Orr, Steve wrote: >cursor.arraysize defaults to 1 but we're getting a significant >performance boost at a plateau of about 1000. Is there any particular >reason we should not set this to 1000 all the time? Apart from >subclassing or modifying Cursor.c, isn't there anyway to change the >default internal to cx_Oracle? > >Steve Orr > > >------------------------------------------------------- >This SF.Net email is sponsored by BEA Weblogic Workshop >FREE Java Enterprise J2EE developer tools! >Get your free copy of BEA WebLogic Workshop 8.1 today. >http://ads.osdn.com/?ad_idG21&alloc_id040&op=click >_______________________________________________ >cx-oracle-users mailing list >cx-...@li... >https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > > |
From: Chris D. <cdu...@ya...> - 2004-07-21 13:03:06
|
Hi, I'm unable to get cx_Oracle to fully display an Oracle 9i Timestamp column: >>> cur = db.cursor() >>> cur.execute("select order_date from oe.orders where rownum < 2") [<TimestampVar object at 0x007EB260>] >>> print cur.description [('ORDER_DATE', <type 'TimestampVar'>, -1, 11, 0, 0, 0)] >>> data = cur.fetchall() >>> print data[0][0] 1999-08-16 22:34:12 >>> type(data[0][0]) <type 'ExternalDateTimeVar'> As you can see the fractions of second aren't being displayed. Maybe there's a clue in that the column is actually being returned into an ExternalDateTimeVar type not a TimestampVar defined by the cursor. This could easily be me jumping to conclusions. I'm running 4.0.1 on a 9.2 client on Windows against a 9.2.0.4 database on Linux. Thanks, Chris Dunscombe Reg __________________________________ Do you Yahoo!? Yahoo! Mail - 50x more storage than other providers! http://promotions.yahoo.com/new_mail |
From: Orr, S. <so...@ri...> - 2004-07-16 19:36:41
|
cursor.arraysize defaults to 1 but we're getting a significant performance boost at a plateau of about 1000. Is there any particular reason we should not set this to 1000 all the time? Apart from subclassing or modifying Cursor.c, isn't there anyway to change the default internal to cx_Oracle?=20 Steve Orr |
From: Michael M. <mi...@ma...> - 2004-07-16 13:04:19
|
Hi, I'm rather new to Python so please excuse any mind blowingly dumb errors below.... I'm trying to write a script to download and format data from Oracle one column of which is a CLOB. I've hit a problem with my script shown with the minimal test case below Mac OS X 10.3.4, python 2.3.4 (non-framework build (as cx_Oracle didn't build against the framework one...) connecting to 9i on Solaris) (password and host information removed..) ###### #!/opt/local/bin/python import cx_Oracle user = 'mike' password = '...' sid = '.....' host = '....' port = 1521 dsn = cx_Oracle.makedsn(host,port,sid) connect = cx_Oracle.connect(user,pass,dsn) cursor = connect.cursor() cursor.execute("select aa_seq from gene3d_admin.g3d_seq") for value, in cursor: value.read() ##### Traceback (most recent call last): File "test.py", line 19, in ? value.read() cx_Oracle.InternalError: No Oracle error? I can get the non-CLOB columns with no problem. I'm confident I'm doing something dumb but extensive googling hasn't helped... any ideas? |
From: D.R. B. <da...@as...> - 2004-06-22 15:06:41
|
Hello Fran=E7ois, My configuration % uname -s -m Linux i686 % cat /etc/redhat-release Red Hat Enterprise Linux AS release 3 (Taroon Update 1) cx_Oracle-4.0.1.tar.gz Oracle 9i & 10g Python 2.2 & 2.3 All possible combinations work out of the box for me. Just unpack the sources, set ORACLE_HOME and run `python setup.py install= '. Danny =20 On Tue, Jun 22, 2004 at 09:35:49AM -0400, fm...@ce... wrote: > Hi all, >=20 > As anyone succeeded in installing cx_oracle on a Red Hat advance server= 3? >=20 > Did try with Rpms designed for Red Hat 9, they install without errors, = but > can't import CX_oracle modules in Python, tried the source code version= , > no success... >=20 > Any ideas? >=20 > Regards, >=20 > Francois >=20 >=20 > ------------------------------------------------------- > This SF.Net email sponsored by Black Hat Briefings & Training. > Attend Black Hat Briefings & Training, Las Vegas July 24-29 -=20 > digital self defense, top technical experts, no vendor pitches,=20 > unmatched networking opportunities. Visit www.blackhat.com > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users |
From: Anthony T. <an...@co...> - 2004-06-22 14:42:47
|
I have not specifically used Red Hat Enterprise 3 but I have used its near equivalent without any difficulty. If you could post the error messages that you are receiving and the level of Python that is installed that would be helpful. I suspect it is something fairly simple to solve but without the error messages I can only guess.... :-) fm...@ce... wrote: > Hi all, > > As anyone succeeded in installing cx_oracle on a Red Hat advance server 3? > > Did try with Rpms designed for Red Hat 9, they install without errors, but > can't import CX_oracle modules in Python, tried the source code version, > no success... > > Any ideas? > > Regards, > > Francois > > > ------------------------------------------------------- > This SF.Net email sponsored by Black Hat Briefings & Training. > Attend Black Hat Briefings & Training, Las Vegas July 24-29 - > digital self defense, top technical experts, no vendor pitches, > unmatched networking opportunities. Visit www.blackhat.com > _______________________________________________ > 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: <fm...@ce...> - 2004-06-22 13:37:59
|
Hi all, As anyone succeeded in installing cx_oracle on a Red Hat advance server 3= ? Did try with Rpms designed for Red Hat 9, they install without errors, bu= t can't import CX_oracle modules in Python, tried the source code version, no success... Any ideas? Regards, Francois |
From: Anthony T. <an...@co...> - 2004-06-14 19:10:40
|
Currently, user defined types are not supported with cx_Oracle. You have to use scalar types and anonymous PL/SQL blocks or call procedures and functions to do the work. I do intend to do something about supporting user defined types but it will be some time before I will have anything useful -- I'm way too busy right now with my own work to deal with things that I don't actually use myself. :-( Fabio Zadrozny wrote: > Hi, > > I would like to define some types on Oracle and use them. > > e.g. > > CREATE TYPE POINT AS OBJECT( > X NUMBER, > Y NUMBER); > > CREATE TYPE POLYGON AS VARRAY(1000) OF POINT; > > CREATE TABLE POLYGONS > ( NAME LONG, > POLY POLYGON); > > I can insert values using: > > insert into polygons values ('p1' , polygon(point(2,2),point(3,3))) ; > > But when I try to fetch them using: > > cursor.execute("SELECT name, poly FROM polygons ") > > I get the following error: > > Traceback (most recent call last): > File "x:\sid15\source\sid\db\tests\test_oracle_conn.py", line 69, in > testIt > cursor.execute("SELECT name, poly FROM polygon ") > NotSupportedError: Variable_TypeByOracleDataType: unhandled data type 108 > > Dows anyone know how can I make it work? > > []s > > Fabio > > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference > Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer > Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA > REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND > _______________________________________________ > 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: Fabio Z. <fa...@es...> - 2004-06-14 18:31:51
|
Hi, I would like to define some types on Oracle and use them. e.g. CREATE TYPE POINT AS OBJECT( X NUMBER, Y NUMBER); CREATE TYPE POLYGON AS VARRAY(1000) OF POINT; CREATE TABLE POLYGONS ( NAME LONG, POLY POLYGON); I can insert values using: insert into polygons values ('p1' , polygon(point(2,2),point(3,3))) ; But when I try to fetch them using: cursor.execute("SELECT name, poly FROM polygons ") I get the following error: Traceback (most recent call last): File "x:\sid15\source\sid\db\tests\test_oracle_conn.py", line 69, in testIt cursor.execute("SELECT name, poly FROM polygon ") NotSupportedError: Variable_TypeByOracleDataType: unhandled data type 108 Dows anyone know how can I make it work? []s Fabio |
From: chris d. <cdu...@ya...> - 2004-06-03 09:53:26
|
Dear List, I'm trying to select data from an NVARCHAR2 col then insert it into another NVARCHAR2 col. This works some of the time and sometimes I get: ORA-01401: inserted value too large for column A specific case of this is using the Oracle 9i sample schema (Create and population scripts for the one required table are in oe_cre.sql and oe_p_d.sql in $ORACLE_HOME/demo/schema/order_entry) Source oe.product_descriptions.translated_name [on database A] where product_id = 1791 and language_id = 'CS'. Target oe.product_descriptions.translated_name [on database B] In the above the database column is NVARCHAR2(50) in char i.e. 100 bytes as the NCHAR set is multibyte. Now the byte length of translated_name for the row in question is 52 and python gives the length of the returned value as 52 as well. However when the insert is done, using cx_Oracle, it fails. However using straight SQL insert into .... select ... across a database link it works fine, for my needs I can't use this type of workaround. (I'm aware this a bit of an unrealistic example but its a simple test case that anyone with 9i server can re-produce) The python code is: import cx_Oracle as cx db1 = cx.connect("oe/test@SXL920D1") db2 = cx.connect("oe/test@SXL920D2") db1Cur = db1.cursor() db2Cur = db2.cursor() db1Cur.execute("select * from product_descriptions where product_id = 1791 and language_id = 'CS'") data = db1Cur.fetchall() dict = {"arg1": data[0][0], "arg2": data[0][1], "arg3": data[0][2], "arg4": data[0][2]} insStr = "insert into product_descriptions (PRODUCT_ID,LANGUAGE_ID,TRANSLATED_NAME,TRANSLATED_DESCRIPTION) values(:arg1, :arg2, :arg3, :arg4)" db2Cur.execute(insStr, dict) I've tried playing around with setinputsizes and had a good google around but with no luck. My environment is Suse Linux 8.2. Python 2.3.3, cx_Oracle 4.0.1 and Oracle 9.2.0.4 Oracle NLS settings are: NLS_CHARACTERSET = WE8ISO8859P1 NLS_NCHAR_CHARACTERSET = AL16UTF16 NLS_LENGTH_SEMANTICS = BYTE Any help would be much appreciated. Thanks very much, Chris Dunscombe __________________________________ Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger. http://messenger.yahoo.com/ |
From: Anthony T. <an...@co...> - 2004-06-02 13:32:30
|
Ah yes, what that means is that you have 64-bit Oracle installed on your machine but you have 32-bit Python installed. You need to make sure that they are consistent -- either install 32-bit Oracle or install a 64-bit Python. Don't forget about the -m64 flag to gcc which tells it to build 64-bit code. Does that clear up the issue? ser...@ac... wrote: > Hi all, > > > > 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: > > > > 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 > > > > > > 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. > |