cx-oracle-users Mailing List for cx_Oracle (Page 129)
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: Amaury F. <Ama...@gl...> - 2006-01-19 16:29:19
|
Hello, For my application I need to add unicode support to cx_Oracle. I even volunteer to make the development (but don't hold your breath). Before this I want to know if some cx_Oracle users have ideas on how unicode should work with cx_Oracle,=20 what should be allowed, and what would be cool to have. I am sure I missed some important points. So here is the first cxEP (cx_Oracle Enhancement Proposal). See if it would fit your needs, and please send me all your additions, questions, remarks... And long live cx_Oracle! Abstract =3D=3D=3D=3D=3D=3D=3D=3D This cx_EP describe how to add unicode support to cx_Oracle. Current State =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D cx_Oracle 4.1.2 does not accept any unicode string at all, and strings are always passed 'as is' to the underlying OCI functions.=20 Strings in cx_Oracle are found in two areas: - system strings: SQL and PL/SQL queries, connect strings, transaction IDs... - data strings: CHAR, VARCHAR, CLOB... The default character set is defined by the surrounding environment (the NLS_LANG variable, or the Windows registry, or by system defaults).=20 By default, all strings are assumed to be encoded in this client character set. This behaviour should be clearly advertised, and will not change. There is also a National Character Set (NLS_NCHAR), used for NCHAR data types. Proposal =3D=3D=3D=3D=3D=3D=3D=3D It is proposed the following features: - Ability to control the character set used in strings, and to use unicode strings. - Ability to deal with unicode and NCHAR data. Default Character Set =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Two module functions: getdefaultencoding() and setdefaultencoding(encoding) allow the application to control the default character set used by the Oracle client. - getdefaultencoding returns a python encoding: latin_1 instead of WE8ISO8859P1. - setdefaultencoding accepts both python and Oracle encodings. Unicode strings are accepted anywhere strings are, and are automatically encoded with this default encoding. An option (todo: find a good name) can be used to set a different error handling scheme. Default value is 'strict', other possible values are 'ignore' and 'replace' (the latter is Oracle default behaviour). See the python help for `unicode.encode`. Changing the encoding while a cursor is opened is likely to return funny results. Note that by construction, returned strings are always encoded with the default encoding and can easily be converted into unicode. NCHAR Data and Unicode Variables =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D There are three new variable types, UNICODE, LONG_UNICODE and LOB_UNICODE. They hold unicode data.=20 Their getvalue() methods return a unicode string.=20 Their setvalue() methods accept both unicode and strings, decoded using getdefaultencoding(). These types are chosen when a column is described as one of the types NCHAR, NVARCHAR and NCLOB, or when building a Variable directly from a unicode value. These types are also be preferred over their string counterparts when getdefaultencoding() is a multi-bytes encoding. (Todo: make this an option, and give it a name. Default should be False, to keep current behaviour) Note that the encoding used to represent unicode values (the National Character Set) is not relevant, as long as it is capable to encode any unicode value. The default value on most databases, AL16UTF16, is correct. Open Issues =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D - RAW, LONG RAW and BLOB datatypes are not subject to the Character Set, and are passed unchanged from Client to Server.=20 Should they accept and convert unicode data? --=20 Amaury Forgeot d'Arc Ubix Development www.ubitrade.com |
From: Anthony T. <ant...@gm...> - 2006-01-19 04:13:39
|
Unfortunately, restarting the database also destroys the pool that you set up. :-( That's the way Oracle works. You'll need to write code yourself to handle that situation. The sessionPool.drop() method is used when you have a connection or set of connections that have become "bad" for some reason -- the session has been killed (alter system kill session command) or a ORA-600 or similar error has occurred making the session unusable. You might also want to use it if you find that the session is "bad" for some other reason -- some application reason, that is. Hope that explains things. On 1/18/06, Forest Wilkinson [sf] <mo...@ti...> wrote: > I just upgraded to cx_Oracle 4.1.2, for the SessionPool.drop() method. > Unfortunately, it doesn't do what I expected. I wanted to use it to > remove a connection from a SessionPool after the Oracle server is bounced= . > Here is what happens in practice: > > >>> import cx_Oracle as cx > >>> p =3D cx.SessionPool( 'user', 'password', 'host/dbname', 0, 10, 2) > >>> co =3D p.acquire() > >>> p.busy, p.opened > (1, 2) > > [restart the databaase at this point] > > >>> p.drop(co) > Traceback (most recent call last): > File "<stdin>", line 1, in ? > cx_Oracle.DatabaseError: ORA-03113: end-of-file on communication channel > >>> p.busy, p.opened > (1, 2) > > As you can see, SessionPool.drop() raises an exception instead of getting > rid of the dead database connection. Is this what's supposed to happen? > If so, can someone explain the purpose of drop()? > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log fi= les > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D103432&bid=3D230486&dat= =3D121642 > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > |
From: Forest W. [sf] <mo...@ti...> - 2006-01-19 00:26:57
|
I just upgraded to cx_Oracle 4.1.2, for the SessionPool.drop() method. Unfortunately, it doesn't do what I expected. I wanted to use it to remove a connection from a SessionPool after the Oracle server is bounced. Here is what happens in practice: >>> import cx_Oracle as cx >>> p = cx.SessionPool( 'user', 'password', 'host/dbname', 0, 10, 2) >>> co = p.acquire() >>> p.busy, p.opened (1, 2) [restart the databaase at this point] >>> p.drop(co) Traceback (most recent call last): File "<stdin>", line 1, in ? cx_Oracle.DatabaseError: ORA-03113: end-of-file on communication channel >>> p.busy, p.opened (1, 2) As you can see, SessionPool.drop() raises an exception instead of getting rid of the dead database connection. Is this what's supposed to happen? If so, can someone explain the purpose of drop()? |
From: Anthony T. <ant...@gm...> - 2006-01-18 15:06:29
|
Ah, then the support in the OCI would only be for accessing an Oracle 9i server. That makes sense and triggers a memory that I was not quite able to retrieve. Thanks. :-) On 1/18/06, Henning von Bargen <H.v...@t-...> wrote: > AFAIK Oracle 8i does not support the TIMESTAMP datatype itself. > > We had a similar problem using Java and JDBC against Oracle 8i. > > Henning > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log fi= les > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://sel.as-us.falkag.net/sel?cmdlnk&kid=103432&bid#0486&dat=121642 > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > |
From: Henning v. B. <H.v...@t-...> - 2006-01-18 08:05:49
|
AFAIK Oracle 8i does not support the TIMESTAMP datatype itself. We had a similar problem using Java and JDBC against Oracle 8i. Henning |
From: Anthony T. <ant...@gm...> - 2006-01-18 03:22:08
|
cx_Oracle currently only supports SQLT_TIMESTAMP for Oracle 9i and above. I don't remember any more why that was the case (since I see the definition in the Oracle 8i headers) so if you are feeling ambitious you can try removing that restriction and seeing if any problems occur. I don't spend a lot of time in Oracle 8i any more and the number of other people using Oracle 8i has dropped considerably as well so I'm not likely to spend any time on this. If you really need this and provide me a patch, though, I'll integrate it. :-) On 1/17/06, copal <co...@dr...> wrote: > hahaha...i'm such a dummy sometimes. too much staring into vim. found t= he > rest of the types...now i just need to figure out why this is failing... > > sorry for my own confusion. > > > On 1/17/06, copal <co...@dr...> wrote: > > i have compiled cx_Oracle-4.1.2 on solaris for Oracle 8.1.6, but am > getting the following error when performing a simple query: > > > > --- snip --- > > > > cx_Oracle.NotSupportedError: Variable_TypeByOracleDataType: unhandled d= ata > type 187 > > > > --- snip --- > > > > a quick grep through $ORACLE_HOME/rdbms/demo/ocidfn.h > shows type 187 as SQLT_TIMESTAMP, but looking though the StringVar.c fil= e > shows only 4 Oracle types listed: SQLT_CHR, SQLT_AFC, SQLT_BIN. > > > > have i missed something incredibly mundane, or does this module (the on= ly > python one listed on oracle's site) really not support datatypes as > rudimentary as timestamps? > > > > incredibly confused - any help would be greatly appreciated. > > > > |
From: copal <co...@dr...> - 2006-01-17 23:43:26
|
hahaha...i'm such a dummy sometimes. too much staring into vim. found the rest of the types...now i just need to figure out why this is failing... sorry for my own confusion. On 1/17/06, copal <co...@dr...> wrote: > > i have compiled cx_Oracle-4.1.2 on solaris for Oracle 8.1.6, but am > getting the following error when performing a simple query: > > --- snip --- > > cx_Oracle.NotSupportedError: Variable_TypeByOracleDataType: unhandled dat= a > type 187 > > --- snip --- > > a quick grep through $ORACLE_HOME/rdbms/demo/ocidfn.h shows type 187 as > SQLT_TIMESTAMP, but looking though the StringVar.c file shows only 4 > Oracle types listed: SQLT_CHR, SQLT_AFC, SQLT_BIN. > > have i missed something incredibly mundane, or does this module (the only > python one listed on oracle's site) really not support datatypes as > rudimentary as timestamps? > > incredibly confused - any help would be greatly appreciated. > |
From: copal <co...@dr...> - 2006-01-17 22:31:47
|
i have compiled cx_Oracle-4.1.2 on solaris for Oracle 8.1.6, but am getting the following error when performing a simple query: --- snip --- cx_Oracle.NotSupportedError: Variable_TypeByOracleDataType: unhandled data type 187 --- snip --- a quick grep through $ORACLE_HOME/rdbms/demo/ocidfn.h shows type 187 as SQLT_TIMESTAMP, but looking though the StringVar.c file shows only 4 Oracl= e types listed: SQLT_CHR, SQLT_AFC, SQLT_BIN. have i missed something incredibly mundane, or does this module (the only python one listed on oracle's site) really not support datatypes as rudimentary as timestamps? incredibly confused - any help would be greatly appreciated. |
From: Anthony T. <ant...@gm...> - 2006-01-16 19:43:23
|
On 1/16/06, Oliver-Mark Cordes <oc...@as...> wrote: > On Mon, 16 Jan 2006, Anthony Tuininga wrote: > > > This error occurs when the Oracle client that cx_Oracle was compiled > > with does not match the client that is currently in use. You have to > > make sure that these match. So perhaps you can give a little more > > information. What Oracle client are you using. Are you building your > > own cx_Oracle or using a precompiled one -- if so, which one. What are > > the values for ORACLE_HOME and LD_LIBRARY_PATH and where is your > > Oracle client installed. If you run "ldd cx_Oracle.so" what is the > > result? Specifically which libclntsh.so is it linked against? Hope > > this helps track it down. > > > > > [...] > > No, this does not help :-( > > I just found the the solution. In the ORACLE_HOME variable an ending "/" > will cause the problem. LD_LIBRARY_PATH and ORACLE_HOME has indeed the > same value, but somehow the Oracle libs don't link ending slashes ... > > Is there a possibility to check the environment valiables in cx_Oracle > first? The would help to track down the problem! Glad to hear you got it sorted out. As for adding the check for the environment variables -- I'm sure it could be arranged but its not a very high priority for me since you're the first person that's actually ran into this problem in this particular way and this is clearly an Oracle problem. Now if you provide me a patch, of course.... :-) > Best wishes, > Oliver > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log fi= les > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://ads.osdn.com/?ad_id=3D7637&alloc_id=3D16865&op=3Dclick > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > |
From: Oliver-Mark C. <oc...@as...> - 2006-01-16 19:10:37
|
On Mon, 16 Jan 2006, Anthony Tuininga wrote: > This error occurs when the Oracle client that cx_Oracle was compiled > with does not match the client that is currently in use. You have to > make sure that these match. So perhaps you can give a little more > information. What Oracle client are you using. Are you building your > own cx_Oracle or using a precompiled one -- if so, which one. What are > the values for ORACLE_HOME and LD_LIBRARY_PATH and where is your > Oracle client installed. If you run "ldd cx_Oracle.so" what is the > result? Specifically which libclntsh.so is it linked against? Hope > this helps track it down. > > [...] No, this does not help :-( I just found the the solution. In the ORACLE_HOME variable an ending "/" will cause the problem. LD_LIBRARY_PATH and ORACLE_HOME has indeed the same value, but somehow the Oracle libs don't link ending slashes ... Is there a possibility to check the environment valiables in cx_Oracle first? The would help to track down the problem! Best wishes, Oliver |
From: Falko S. <Fal...@gm...> - 2006-01-16 19:10:21
|
On Mon, 16 Jan 2006 19:08:54 +0100 (CET) Oliver-Mark Cordes <oc...@as...> wrote: > Looking into the source code I found that "OCIEnvCreate" creates the error > message. ... ... > Any suggestions? I had the same problem (OCIEnvCreate failed) with a small OCI application. The reason was that oraInstaller set strange file and directory permissions in $ORACLE_HOME, e.g.: # ls -ld mesg drwxr-x--- 2 oracle10 users 144 Sep 14 18:47 mesg/ After fixing this ("chmod o+rx" for all directories, "chmod o+r" for all files in the $ORACLE_HOME subtree) all OCI applications are working as expected. HTH, Falko |
From: Anthony T. <ant...@gm...> - 2006-01-16 18:33:39
|
This error occurs when the Oracle client that cx_Oracle was compiled with does not match the client that is currently in use. You have to make sure that these match. So perhaps you can give a little more information. What Oracle client are you using. Are you building your own cx_Oracle or using a precompiled one -- if so, which one. What are the values for ORACLE_HOME and LD_LIBRARY_PATH and where is your Oracle client installed. If you run "ldd cx_Oracle.so" what is the result? Specifically which libclntsh.so is it linked against? Hope this helps track it down. On 1/16/06, Oliver-Mark Cordes <oc...@as...> wrote: > Hi! > > I got the error message "Unable to acquire Oracle environment handle" and > I'm a little bit puzzled that it is not functioning. > > The problem is NOT: > - ORACLE_HOME > - LD_LIBRARY_PATH > - Debian Linux > - TNS_ADMIN > > All necessary variables are set and working. With sqlplus I get the wante= d > connection to the database. > > The funny thing is that I get the error using the Oracle instant client o= r > other client installation but not with an export of the full database > installation I'm using on a different machine. The next thing I tried is > to use the module compiled on a working environment which also fails > (oracle library and linking were OK). > > Looking into the source code I found that "OCIEnvCreate" creates the erro= r > message. If I understand it correctly OCIEnvCreate has to be called befor= e > other Oracle function can be called right? So questions about a correct > server,password etc as I found in the net are stupid ;-) I wrote a small > C-Program and used the same compile options: > > /* small program */ > #include <stdlib.h> > > #include <stdio.h> > > #include "oratypes.h" > > #include "ociap.h" > > int main( int argc, char *argv[] ) > { > OCIEnv *envhandle; > > sword status; > ub4 mode; > > mode =3D OCI_OBJECT; > envhandle =3D NULL; > > printf( "%i\n", mode ); > > mode =3D !OCI_THREADED; > > status =3D OCIEnvCreate( &envhandle, mode, NULL, NULL, NULL, NULL, 0, = NULL > ); > > printf( "%i\n", status ); > > if (!envhandle ) > printf( "Unable to acquire Oracle environment handle!\n" ); > else > printf( "Success!\n" ); > > return 0; > } > > > /* end of small program */ > > This program works fine with my installation of the client! Btw, it is th= e > recent client of the Oracle 10g distribution. > > > Any suggestions? > > > Thanks for help, > > Oliver > > > PS: Sorry for my tone, but Oracle is driving me crazy. We have to use > Oracle and cx_Oracle for an important project and my boss is pressing ... > > > > -- > (O> (0- _o) -O) > //\ //\ /\\ /\\ > V_/_ V_/_ _\_V _\_V > > Dr. Oliver-M. Cordes E-Mail: oc...@as... > Sternwarte der WWW-URL: http://www.astro.uni-bonn.de/~ocor= des/ > Universitaet Bonn Phone: (49) 228 / 73-5656 > Auf dem Huegel 71 Fax: (49) 228 / 73-3672 > D - 53121 Bonn Germany > > Private address: Witterschlickerstr. 22 , D - 53123 Bonn > Private phone: (49) 228 / 7482582 > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log fi= les > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://ads.osdn.com/?ad_id=3D7637&alloc_id=3D16865&op=3Dclick > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > |
From: Oliver-Mark C. <oc...@as...> - 2006-01-16 18:09:01
|
Hi! I got the error message "Unable to acquire Oracle environment handle" and I'm a little bit puzzled that it is not functioning. The problem is NOT: - ORACLE_HOME - LD_LIBRARY_PATH - Debian Linux - TNS_ADMIN All necessary variables are set and working. With sqlplus I get the wanted connection to the database. The funny thing is that I get the error using the Oracle instant client or other client installation but not with an export of the full database installation I'm using on a different machine. The next thing I tried is to use the module compiled on a working environment which also fails (oracle library and linking were OK). Looking into the source code I found that "OCIEnvCreate" creates the error message. If I understand it correctly OCIEnvCreate has to be called before other Oracle function can be called right? So questions about a correct server,password etc as I found in the net are stupid ;-) I wrote a small C-Program and used the same compile options: /* small program */ #include <stdlib.h> #include <stdio.h> #include "oratypes.h" #include "ociap.h" int main( int argc, char *argv[] ) { OCIEnv *envhandle; sword status; ub4 mode; mode = OCI_OBJECT; envhandle = NULL; printf( "%i\n", mode ); mode = !OCI_THREADED; status = OCIEnvCreate( &envhandle, mode, NULL, NULL, NULL, NULL, 0, NULL ); printf( "%i\n", status ); if (!envhandle ) printf( "Unable to acquire Oracle environment handle!\n" ); else printf( "Success!\n" ); return 0; } /* end of small program */ This program works fine with my installation of the client! Btw, it is the recent client of the Oracle 10g distribution. Any suggestions? Thanks for help, Oliver PS: Sorry for my tone, but Oracle is driving me crazy. We have to use Oracle and cx_Oracle for an important project and my boss is pressing ... -- (O> (0- _o) -O) //\ //\ /\\ /\\ V_/_ V_/_ _\_V _\_V Dr. Oliver-M. Cordes E-Mail: oc...@as... Sternwarte der WWW-URL: http://www.astro.uni-bonn.de/~ocordes/ Universitaet Bonn Phone: (49) 228 / 73-5656 Auf dem Huegel 71 Fax: (49) 228 / 73-3672 D - 53121 Bonn Germany Private address: Witterschlickerstr. 22 , D - 53123 Bonn Private phone: (49) 228 / 7482582 |
From: Anthony T. <ant...@gm...> - 2006-01-12 14:28:27
|
Actually, if all you want to distinguish between is queries and non-queries there is an easier way. Simply ask for cursor.description -- the value returned is None in only two cases. 1) no statement executed and 2) the statement executed is not a query. Seems to fit the bill, don't you think? On 1/11/06, Mihai Ibanescu <mi...@re...> wrote: > On Wed, Jan 11, 2006 at 06:55:03PM -0500, Mihai Ibanescu wrote: > > Hi, > > > > Is there a way one can prepare a query and determine its type? > > (select/update/insert/delete). > > > > The reason: executemany() only applies to update/insert/delete. I have = a > > module that executes queries passed in by the user, and gets the bind p= arams > > from a .csv file. It would be nice to know when I can use execute vs. > > executemany. It also helps to know if one has to fetch a result set (in= case > > of a select) or not do anything (for insert/update/delete). > > > > I know in OCI you can check the type by comparing to OCI_STMT_SELECT et= al - > > is the statement type somewhat exposed at the Python level? > > ... to reply to myself, exposing self->satementType as set by > Cursor_GetStatementType to python, that's kind of what I'm looking for. I > don't see it done, would others find it to be valuable? > > It would probably require a new read-only attribute of a Cursor object > exposed, and a bunch of constants OCI_STMT_* defined. > > Misa > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log fi= les > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://ads.osdn.com/?ad_id=3D7637&alloc_id=3D16865&op=3Dclick > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > |
From: Mihai I. <mi...@re...> - 2006-01-11 23:58:14
|
On Wed, Jan 11, 2006 at 06:55:03PM -0500, Mihai Ibanescu wrote: > Hi, > > Is there a way one can prepare a query and determine its type? > (select/update/insert/delete). > > The reason: executemany() only applies to update/insert/delete. I have a > module that executes queries passed in by the user, and gets the bind params > from a .csv file. It would be nice to know when I can use execute vs. > executemany. It also helps to know if one has to fetch a result set (in case > of a select) or not do anything (for insert/update/delete). > > I know in OCI you can check the type by comparing to OCI_STMT_SELECT et al - > is the statement type somewhat exposed at the Python level? ... to reply to myself, exposing self->satementType as set by Cursor_GetStatementType to python, that's kind of what I'm looking for. I don't see it done, would others find it to be valuable? It would probably require a new read-only attribute of a Cursor object exposed, and a bunch of constants OCI_STMT_* defined. Misa |
From: Mihai I. <mi...@re...> - 2006-01-11 23:52:56
|
Hi, Is there a way one can prepare a query and determine its type? (select/update/insert/delete). The reason: executemany() only applies to update/insert/delete. I have a module that executes queries passed in by the user, and gets the bind params from a .csv file. It would be nice to know when I can use execute vs. executemany. It also helps to know if one has to fetch a result set (in case of a select) or not do anything (for insert/update/delete). I know in OCI you can check the type by comparing to OCI_STMT_SELECT et al - is the statement type somewhat exposed at the Python level? Thanks, Misa |
From: Anthony T. <ant...@gm...> - 2005-12-23 17:33:57
|
Ah yes, you are missing xa.h. You'll need to have that installed (or rip out the parts of cx_Oracle that refer to it if you'd prefer to do that). Unfortunately this is not installed by default in 8.1.7 and I can't remember which section it is installed with. You'll have to look into the Oracle install -- or beg somebody to send you that particular file. :-) On 12/23/05, Gustavo Rahal <gu...@gr...> wrote: > Hi All > > I'm having problems installing the cx_Oracle. The output is below. > before running python setup.py install > > I executed > > export LD_LIBRARY_PATH=3D$LD_LIBRARY_PATH:$ORACLE_HOME/lib > > > Thanks > Gustavo > > Output: > **************************************************************** > running install > running build > running build_ext > building 'cx_Oracle' extension > creating build > creating build/temp.linux-i686-2.4 > gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall > -Wstrict-prototypes -fPIC -I/usr/local/oracle/rdbms/demo > -I/usr/local/oracle/rdbms/public -I/usr/local/oracle/network/public > -I/usr/local/include/python2.4 -c cx_Oracle.c -o > build/temp.linux-i686-2.4/cx_Oracle.o -DBUILD_TIME=3D"December 23, 2005 > 07:28:07" > In file included from /usr/local/oracle/rdbms/demo/oci.h:1648, > from cx_Oracle.c:9: > /usr/local/oracle/rdbms/demo/oci1.h:148: warning: function declaration > isn't a prototype > In file included from /usr/local/oracle/rdbms/demo/oci.h:1673, > from cx_Oracle.c:9: > /usr/local/oracle/rdbms/demo/ociap.h:6271: warning: function declaration > isn't a prototype > /usr/local/oracle/rdbms/demo/ociap.h:8753: warning: function declaration > isn't a prototype > /usr/local/oracle/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:89, > from Cursor.c:211, > from Connection.c:303, > from cx_Oracle.c:75: > NumberVar.c: In function `NumberVar_SetValue': > NumberVar.c:178: warning: passing arg 4 of `OCINumberFromText' discards > qualifiers from pointer target type > In file included from Variable.c:93, > from Cursor.c:211, > from Connection.c:303, > from cx_Oracle.c:75: > DateTimeVar.c: In function `DateTimeVar_SetValue': > DateTimeVar.c:81: warning: unused variable `status' > In file included from cx_Oracle.c:75: > Connection.c: In function `Connection_Begin': > Connection.c:650: error: `XID' undeclared (first use in this function) > Connection.c:650: error: (Each undeclared identifier is reported only onc= e > Connection.c:650: error: for each function it appears in.) > Connection.c:650: error: parse error before "xid" > Connection.c:658: error: `MAXGTRIDSIZE' undeclared (first use in this > function) > Connection.c:662: error: `MAXBQUALSIZE' undeclared (first use in this > function) > Connection.c:680: error: `xid' undeclared (first use in this function) > error: command 'gcc' failed with exit status 1 > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log fi= les > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://ads.osdn.com/?ad_id=3D7637&alloc_id=3D16865&op=3Dclick > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > |
From: Gustavo R. <gu...@gr...> - 2005-12-23 13:50:46
|
Hi All I'm having problems installing the cx_Oracle. The output is below. before running python setup.py install I executed export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib Thanks Gustavo Output: **************************************************************** running install running build running build_ext building 'cx_Oracle' extension creating build creating build/temp.linux-i686-2.4 gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/oracle/rdbms/demo -I/usr/local/oracle/rdbms/public -I/usr/local/oracle/network/public -I/usr/local/include/python2.4 -c cx_Oracle.c -o build/temp.linux-i686-2.4/cx_Oracle.o -DBUILD_TIME="December 23, 2005 07:28:07" In file included from /usr/local/oracle/rdbms/demo/oci.h:1648, from cx_Oracle.c:9: /usr/local/oracle/rdbms/demo/oci1.h:148: warning: function declaration isn't a prototype In file included from /usr/local/oracle/rdbms/demo/oci.h:1673, from cx_Oracle.c:9: /usr/local/oracle/rdbms/demo/ociap.h:6271: warning: function declaration isn't a prototype /usr/local/oracle/rdbms/demo/ociap.h:8753: warning: function declaration isn't a prototype /usr/local/oracle/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:89, from Cursor.c:211, from Connection.c:303, from cx_Oracle.c:75: NumberVar.c: In function `NumberVar_SetValue': NumberVar.c:178: warning: passing arg 4 of `OCINumberFromText' discards qualifiers from pointer target type In file included from Variable.c:93, from Cursor.c:211, from Connection.c:303, from cx_Oracle.c:75: DateTimeVar.c: In function `DateTimeVar_SetValue': DateTimeVar.c:81: warning: unused variable `status' In file included from cx_Oracle.c:75: Connection.c: In function `Connection_Begin': Connection.c:650: error: `XID' undeclared (first use in this function) Connection.c:650: error: (Each undeclared identifier is reported only once Connection.c:650: error: for each function it appears in.) Connection.c:650: error: parse error before "xid" Connection.c:658: error: `MAXGTRIDSIZE' undeclared (first use in this function) Connection.c:662: error: `MAXBQUALSIZE' undeclared (first use in this function) Connection.c:680: error: `xid' undeclared (first use in this function) error: command 'gcc' failed with exit status 1 |
From: Mikel L. <mla...@co...> - 2005-12-20 14:58:08
|
Anthony Tuininga wrote: > You definitely need to have oci.h available and if its not present > that means that OCI support was not installed. You'll have to ask them > to install it for you then. So OCI support of the Oracle client is what is missing... Sorry for my question, perhaps it was a more Oracle question than cx_Oracle one, but the sysadmin told be everything was installed and I didn't know where to ask for help. Thank you, I'll keep you informed if I get something. After talking to the sysadmin, I don't need to install cx_Oracle in that system for now, perhaps I'll need it in the future. Thanks again. -- Mikel Larreategi mla...@co... CodeSyntax Azitaingo Industrialdea 3 K E-20600 Eibar Tel: (+34) 943 82 17 80 |
From: Anthony T. <ant...@gm...> - 2005-12-20 14:47:04
|
You definitely need to have oci.h available and if its not present that means that OCI support was not installed. You'll have to ask them to install it for you then. On 12/20/05, Mikel Larreategi <mla...@co...> wrote: > Hi: > > I'm trying to build cx_Oracle in a Solaris system with Oracle client 9 > installed (both 32 and 64 bit versions according to the sysadmin). > > As I have no access at all to the machine (that's the way administration > works sometimes here) I can't exactly know what happens there, they just > sent me this installation traceback (cx_Oracle version 4.1.1):: > > bash-2.05$ /home1/zope/python/235/bin/python setup.py build > running build > running build_ext > building 'cx_Oracle' extension > creating build > creating build/temp.solaris-2.9-sun4u-2.3 > gcc -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC > -I/oracle/9.2.0/rdbms/demo -I/oracle/9.2.0/rdbms/public > -I/oracle/9.2.0/network/public > -I/home1/zope/python/235/include/python2.3 -c cx_Oracle.c -o > build/temp.solaris-2.9-sun4u-2.3/cx_Oracle.o -DBUILD_TIME=3D"December 19, > 2005 16:13:41" > cx_Oracle.c:9: oci.h: No such file or directory > error: command 'gcc' failed with exit status 1 > bash-2.05$ > > The sysadmin tells me there is no 'oci.h' throughout the system, so I > don't know what can happen, as far as I am not familiar with Oracle > installations I don't know where to find the 'oci.h', or what should I > do to install it (is there a complete or reduced Oracle client > installation? Perhaps I'm telling nonsense...) > > Any hint will be appreciated. > > Thank you, > > -- > Mikel Larreategi > mla...@co... > > CodeSyntax > Azitaingo Industrialdea 3 K > E-20600 Eibar > Tel: (+34) 943 82 17 80 > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log fi= les > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://ads.osdn.com/?ad_id=3D7637&alloc_id=3D16865&op=3Dclick > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > |
From: Mikel L. <mla...@co...> - 2005-12-20 08:56:37
|
Hi: I'm trying to build cx_Oracle in a Solaris system with Oracle client 9 installed (both 32 and 64 bit versions according to the sysadmin). As I have no access at all to the machine (that's the way administration works sometimes here) I can't exactly know what happens there, they just sent me this installation traceback (cx_Oracle version 4.1.1):: bash-2.05$ /home1/zope/python/235/bin/python setup.py build running build running build_ext building 'cx_Oracle' extension creating build creating build/temp.solaris-2.9-sun4u-2.3 gcc -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I/oracle/9.2.0/rdbms/demo -I/oracle/9.2.0/rdbms/public -I/oracle/9.2.0/network/public -I/home1/zope/python/235/include/python2.3 -c cx_Oracle.c -o build/temp.solaris-2.9-sun4u-2.3/cx_Oracle.o -DBUILD_TIME="December 19, 2005 16:13:41" cx_Oracle.c:9: oci.h: No such file or directory error: command 'gcc' failed with exit status 1 bash-2.05$ The sysadmin tells me there is no 'oci.h' throughout the system, so I don't know what can happen, as far as I am not familiar with Oracle installations I don't know where to find the 'oci.h', or what should I do to install it (is there a complete or reduced Oracle client installation? Perhaps I'm telling nonsense...) Any hint will be appreciated. Thank you, -- Mikel Larreategi mla...@co... CodeSyntax Azitaingo Industrialdea 3 K E-20600 Eibar Tel: (+34) 943 82 17 80 |
From: Anthony T. <ant...@gm...> - 2005-12-19 17:28:20
|
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) Restore support of Oracle 9i features when using the Oracle 10g client. Anthony Tuininga |
From: Anthony T. <ant...@gm...> - 2005-12-19 14:36:24
|
Oops. Good catch. I'll make another release of cx_Oracle with this patch (the first one you suggested) shortly. We don't use session pools with Oracle 10g (yet) and the test suite simply looks for the presence of the attribute.... :-) I really wish Oracle would provide some indication of what client version was in use! On 12/19/05, Amaury Forgeotdarc <Ama...@gl...> wrote: > Hello Anthony, > > Thanks for this new release of cx_Oracle. > > However, I am surprised by this change: > > #ifdef OCI_ATTR_MODULE > #define ORACLE_10G > #elif OCI_FNCODE_STMTRELEASE > #define ORACLE_9I > #endif > > This implies that with Oracle 10, session pools and timestamps > are no more available... I don't think this was intended. > > I can see two possible workarounds: > > - When compiling with Oracle 10, both ORACLE_10G and ORACLE_9I > are defined. This is what I have done in my local copy. > > - We could change the define to look like a version number: > #ifdef OCI_ATTR_MODULE > #define CX_OCI_VERSION 1000 > #elif OCI_FNCODE_STMTRELEASE > #define CX_OCI_VERSION 901 > #else > #define CX_OCI_VERSION 815 > #endif > And use it this way: > #if CX_OCI_VERSION >=3D 901 > ...session pools... > #endif > > Just to keep > > -- > Amaury Forgeot d'Arc > Ubix Development > www.ubitrade.com > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log fi= les > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://ads.osdn.com/?ad_idv37&alloc_id=16865&opclick > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > |
From: Amaury F. <Ama...@gl...> - 2005-12-19 09:36:01
|
Hello Anthony, Thanks for this new release of cx_Oracle. However, I am surprised by this change: #ifdef OCI_ATTR_MODULE #define ORACLE_10G #elif OCI_FNCODE_STMTRELEASE #define ORACLE_9I #endif This implies that with Oracle 10, session pools and timestamps=20 are no more available... I don't think this was intended. I can see two possible workarounds: - When compiling with Oracle 10, both ORACLE_10G and ORACLE_9I=20 are defined. This is what I have done in my local copy. - We could change the define to look like a version number: #ifdef OCI_ATTR_MODULE #define CX_OCI_VERSION 1000 #elif OCI_FNCODE_STMTRELEASE #define CX_OCI_VERSION 901 #else #define CX_OCI_VERSION 815 #endif And use it this way: #if CX_OCI_VERSION >=3D 901 ...session pools... #endif Just to keep --=20 Amaury Forgeot d'Arc Ubix Development www.ubitrade.com |
From: Anthony T. <ant...@gm...> - 2005-12-16 21:41:18
|
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) Add support for dropping a connection from a session pool. 2) Add support for write only attributes "module", "action" and "clientinf= o" which work only in Oracle 10g as requested by Egor Starostin. 3) Add support for pickling database errors. 4) Use the previously created bind variable as a template if available whe= n creating a new variable of a larger size. Thanks to Ted Skolnick for = the initial patch. 5) Fixed tests to work properly in the Python 2.4 environment where dates = and timestamps are different Python types. Thanks to Henning von Bargen f= or pointing this out. 6) Added additional directories to search for include files and libraries = in order to better support the Oracle 10g instant client. 7) Set the internal fetch number to 0 in order to satisfy very picky sourc= e analysis tools as requested by Amaury Fogeot d'Arc. 8) Improve the documentation for building and installing the module from source as some people are unaware of the standard methods for buildin= g Python modules using distutils. 9) Added note in the documentation indicating that the arraysize attribute can drastically affect performance of queries since this seems to be = a common misunderstanding of first time users of cx_Oracle. 10) Add a comment indicating that on HP-UX Itanium with Oracle 10g the libr= ary ttsh10 must alos be linked against. Thanks to Bernard Delmee for the information. Anthony Tuininga |