cx-oracle-users Mailing List for cx_Oracle (Page 120)
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: Tim H. <tho...@en...> - 2006-10-10 21:18:41
|
Anthony Tuininga <anthony.tuininga@...> writes: > 2) cursor.var() is available to create a variable that you can pass in > and get a value out after the call is complete > > Hopefully this helps. > Yep - I just needed to use var() to setup my output parameters. I thought I needed to use setinputsize() or something, but for NUMBER parameters it works fine now. Thanks! |
From: Anthony T. <ant...@gm...> - 2006-10-10 20:53:51
|
Hmm, not sure exactly what you are trying to accomplish so I'll give you a few pointers. If they don't help you any, please send some actual code that you are attempting to execute -- not just the PL/SQL but also the Python and the code that calls the Python method. 1) cursor.callproc() returns a modified list of arguments -- see the DB API for more details 2) cursor.var() is available to create a variable that you can pass in and get a value out after the call is complete Hopefully this helps. On 10/10/06, Tim Holcomb <tho...@en...> wrote: > When I use the following code to return a sys_refcursor, it works great: > > def calldb_cursor(self, procname, args): > """Call a stored procedure that has a cursor as an OUT parameter.""" > outcur = self.con.cursor() > args.append(outcur) > self.cur.callproc(procname, args) > return outcur > > I don't setoutputsize or var to specify a cursor type. When I use a similar > approach for other OUT parameter types, I don't get any data after the call. > > def calldb_proc(self, procname, args): > """Call a database stored procedure.""" > self.cur.callproc(procname, args) > > example: > The stored procedure takes a user name and inserts a new user into the table > and fills 'uid' with a sequence-based unique id: > PROCEDURE SP_ADD_USER ( > uid OUT INTEGER, > p_first_name IN VARCHAR2, > p_last_name IN VARCHAR2); > > Can someone provide an example of how to call this proc with cx_Oracle > setXXXsize() such that I get the proper values in in my OUT params? > > Thanks in advance! > > Tim Holcomb > > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > |
From: Tim H. <tho...@en...> - 2006-10-10 20:20:24
|
When I use the following code to return a sys_refcursor, it works great: def calldb_cursor(self, procname, args): """Call a stored procedure that has a cursor as an OUT parameter.""" outcur = self.con.cursor() args.append(outcur) self.cur.callproc(procname, args) return outcur I don't setoutputsize or var to specify a cursor type. When I use a similar approach for other OUT parameter types, I don't get any data after the call. def calldb_proc(self, procname, args): """Call a database stored procedure.""" self.cur.callproc(procname, args) example: The stored procedure takes a user name and inserts a new user into the table and fills 'uid' with a sequence-based unique id: PROCEDURE SP_ADD_USER ( uid OUT INTEGER, p_first_name IN VARCHAR2, p_last_name IN VARCHAR2); Can someone provide an example of how to call this proc with cx_Oracle setXXXsize() such that I get the proper values in in my OUT params? Thanks in advance! Tim Holcomb |
From: Anthony T. <ant...@gm...> - 2006-10-10 13:33:10
|
cx_Oracle currently does not support binding unicode directly. You will have to do the following: unicodeString.decode(connection.encoding) OR unicodeString.decode(connection.nencoding) depending on whether you are inserting into varchar2 or nvarchar2 This necessity will be removed at some point but I'm not sure exactly when yet. :-) I'm still learning about unicode and I don't want to do anything too hastily. On 10/8/06, Vizcayno Tamparantan <pre...@ho...> wrote: > > Hello: > I have have problems saving ascii and unicode data that contains spanish > symbols, please look at the next py25 code using last version of cx_oracl= e > under Windows XP2: > # -*- coding: utf-8 -*- > import cx_Oracle as Ora > connOra =3D Ora.connect("user", "pass", "DB") > cursOra =3D connOra.cursor() > cursOra.execute("CREATE TABLE ASCTAB (txt VARCHAR2(30))") > connOra.commit() > txt =3D "=E1=E9=ED=F3=FA > =F1=D1 > =BF?" > print "String: ", txt > cursOra.execute("INSERT INTO ASCTAB VALUES('%s')" % txt) > connOra.commit() > cursOra.execute("SELECT * FROM ASCTAB") > for i in cursOra.fetchall(): > print "DB data: ", i[0] > > cursOra.execute("CREATE TABLE UNITAB (txt NVARCHAR2(30))") > connOra.commit() > uTxt =3D unicode('"=E1=E9=ED=F3=FA > =F1=D1 > =BF?"', 'latin-1') > print "Unicode: ", uTxt > cursOra.execute("INSERT INTO UNITAB VALUES('%s')" % uTxt) > connOra.commit() > cursOra.execute("SELECT * FROM UNITAB") > for i in cursOra.fetchall(): > print i[0] > > connOra.close() > > The results I get after executing previous program are: > .python test.py > String: =DF=DA=DD=BE=B7 > =B1=D0 > +? > DB data: ????? > ?? > ?? > Unicode: "=E1=E9=ED=F3=FA > =F1=D1 > =BF?" > Traceback (most recent call last): > File "test.py", line 19, in <module> > cursOra.execute("INSERT INTO UNITAB VALUES('%s')" % uTxt) > TypeError: expecting None or a string > > SQL> select * from asctab; > > TXT > ------------------------------ > ????? > ?? > ?? > > SQL> > > > The source file test.py was saved as utf-8. > > How can I save and retrieve spanish characters in a correct way? > > Many thanks for your help. > > _________________________________________________________________ > MSN Amor: busca tu =BD naranja http://latam.msn.com/amor/ > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share y= our > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D= DEVDEV > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > |
From: Vizcayno T. <pre...@ho...> - 2006-10-09 04:53:54
|
Hello: I have have problems saving ascii and unicode data that contains spanish symbols, please look at the next py25 code using last version of cx_oracle under Windows XP2: # -*- coding: utf-8 -*- import cx_Oracle as Ora connOra = Ora.connect("user", "pass", "DB") cursOra = connOra.cursor() cursOra.execute("CREATE TABLE ASCTAB (txt VARCHAR2(30))") connOra.commit() txt = "áéíóú > ñÑ > ¿?" print "String: ", txt cursOra.execute("INSERT INTO ASCTAB VALUES('%s')" % txt) connOra.commit() cursOra.execute("SELECT * FROM ASCTAB") for i in cursOra.fetchall(): print "DB data: ", i[0] cursOra.execute("CREATE TABLE UNITAB (txt NVARCHAR2(30))") connOra.commit() uTxt = unicode('"áéíóú > ñÑ > ¿?"', 'latin-1') print "Unicode: ", uTxt cursOra.execute("INSERT INTO UNITAB VALUES('%s')" % uTxt) connOra.commit() cursOra.execute("SELECT * FROM UNITAB") for i in cursOra.fetchall(): print i[0] connOra.close() The results I get after executing previous program are: .python test.py String: ßÚݾ· > ±Ð > +? DB data: ????? > ?? > ?? Unicode: "áéíóú > ñÑ > ¿?" Traceback (most recent call last): File "test.py", line 19, in <module> cursOra.execute("INSERT INTO UNITAB VALUES('%s')" % uTxt) TypeError: expecting None or a string SQL> select * from asctab; TXT ------------------------------ ????? > ?? > ?? SQL> The source file test.py was saved as utf-8. How can I save and retrieve spanish characters in a correct way? Many thanks for your help. _________________________________________________________________ MSN Amor: busca tu ½ naranja http://latam.msn.com/amor/ |
From: Laurelin of M. E. <la...@fn...> - 2006-10-05 17:53:55
|
Thus spaketh Anthony Tuininga on 10/05/2006 11:23 AM: > On 10/4/06, Laurelin of Middle Earth <la...@fn...> wrote: > >> [snippage] >>Unless the cx_Oracle.Connection instance knows how to reconnect >>itself.... > > > It doesn't currently -- but its entirely possible that it could. Of > course any current cursors would be invalidated by such a move. That > might end up causing more trouble than its worth.... As has already > been noted attempting to restart something in the middle may not be > very effective as well. Are you certain that this is the solution you > need and would a reconnect() method help you? Would you need this > "right away" as well? > My RetryHandler knows about certain "transactions" -- that is, things that require both "execute" (or "callfunc") and a series of one or more "fetchXXX" calls. If any of the elements fails, it will go back to the beginning of the transaction. So I think I've handled the case of "restarting something in the middle", at least for the situations of interest to me. As for invalidating current cursors... hmmm.... I guess I don't understand (but that's not unusual ;-). My hope was that the cursor would become "usable" again by re-connecting its existing connection rather than creating a new connection. Of course you cannot continue with anything that you are currently executing in that cursor -- but if the connection is dead, then the cursor can't be doing much of anything anyway, right? In my case, what I was hoping could happen would be something along the lines of the pseudo-code: done = False while not done: try: cursor.callfunc(...) cursor.do_whatever_fetch_XXX(...) done = True except ConnectionIsDeadException: cursor.connection.reconnect() except RetriableException: pass "Right away"? Yes, of course -- yesterday would be optimal. ;-) No, we have a workaround that is getting us by for the time being, and I'm not presumptuous enough to think that you have free time to spend on solving my problems. "At your convenience (but the sooner the better)" is just fine. Thanks, lauri |
From: Anthony T. <ant...@gm...> - 2006-10-05 16:31:11
|
Apologies if this is a duplicate now..... The other option is to simply run int(cursor.callfunc()) which is what I have done when I really wanted an integer returned. Others have asked for this so I may add another type object called INTEGER to make this simpler. On 10/5/06, Amaury Forgeot d'Arc <ama...@gm...> wrote: > 2006/10/2, Anthony Tuininga wrote: > > Could someone please reply to this e-mail indicating they received it. > > I've just received a couple of bounce messages for two of my latest > > posts. > > I've just received it. > I also got two messages rejected last week. > I sent my answer directly to the OP. For the record, here it is: > > James Reese wrote: > > Hi, > > > > I'm using the cx_Oracle cursor method callfunc() to call an Oracle > > function that returns type INTEGER. Is there any way to get callfunc > > () to return a Python integer value instead of a float? > > I suppose that you wrote > cursor.callfunc("myFunc", cx_Oracle.NUMBER) > > If you pass a variable object instead of the variable type, you may > force it to return integer values: > var = cursor.var(cxOracle.NUMBER) > var.setvalue(0, 0) # sets the value to an int, this forces the > variable's return type > cursor.callfunc("myFunc", var) > > But AFAIK there is no automatic detection of the Oracle function's return type. > Hope this helps > > > I apologize if the answer to this is well-known. > I don't think so... > > -- > Amaury Forgeot d'Arc > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > |
From: Anthony T. <ant...@gm...> - 2006-10-05 16:23:07
|
On 10/4/06, Laurelin of Middle Earth <la...@fn...> wrote: > Unfortunately, this won't work for the case I'm trying to solve > because the connection that is given to me is (and must remain) > a cx_Oracle.Connection. No matter how I wrap it and mungle it > at my end, the connection that the caller has passed me *is* > the connection. If I change it or reconnect, then essentially > I am using a *new*, separate connection, and the caller still > has its dead connection. > > Unless the cx_Oracle.Connection instance knows how to reconnect > itself.... It doesn't currently -- but its entirely possible that it could. Of course any current cursors would be invalidated by such a move. That might end up causing more trouble than its worth.... As has already been noted attempting to restart something in the middle may not be very effective as well. Are you certain that this is the solution you need and would a reconnect() method help you? Would you need this "right away" as well? > Thanks, lauri > > Thus spaketh Amaury Forgeot d'Arc on 10/04/2006 03:22 AM: > > > [snippage] > > > > A solution could be to wrap both classes (connection and cursor) > > inside "RetryingConnection", "RetryingCursor" classes. They delegate > > all calls to their base objects, but the RetryingConnection.cursor() > > function returns a wrapped RetryingCursor. > ... > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > |
From: Anthony T. <ant...@gm...> - 2006-10-05 16:19:09
|
Great. It would appear that the lists were bouncing everything for a while and that things are back to normal agin. On 10/5/06, Dale Smith <DS...@al...> wrote: > Received it > > -----Original Message----- > From: cx-...@li... > [mailto:cx-...@li...] On Behalf Of > Anthony Tuininga > Sent: Monday, October 02, 2006 10:19 AM > To: cx-...@li... > Subject: Re: [cx-oracle-users] Calling function returning INTEGER > > Could someone please reply to this e-mail indicating they received it. > I've just received a couple of bounce messages for two of my latest > posts. > > ------------------------------------------------------------------------ > - > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDE > V > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > |
From: Amaury F. d'A. <ama...@gm...> - 2006-10-05 15:14:28
|
2006/10/2, Anthony Tuininga wrote: > Could someone please reply to this e-mail indicating they received it. > I've just received a couple of bounce messages for two of my latest > posts. I've just received it. I also got two messages rejected last week. I sent my answer directly to the OP. For the record, here it is: James Reese wrote: > Hi, > > I'm using the cx_Oracle cursor method callfunc() to call an Oracle > function that returns type INTEGER. Is there any way to get callfunc > () to return a Python integer value instead of a float? I suppose that you wrote cursor.callfunc("myFunc", cx_Oracle.NUMBER) If you pass a variable object instead of the variable type, you may force it to return integer values: var = cursor.var(cxOracle.NUMBER) var.setvalue(0, 0) # sets the value to an int, this forces the variable's return type cursor.callfunc("myFunc", var) But AFAIK there is no automatic detection of the Oracle function's return type. Hope this helps > I apologize if the answer to this is well-known. I don't think so... -- Amaury Forgeot d'Arc |
From: Laurelin of M. E. <la...@fn...> - 2006-10-05 15:07:41
|
I got it. -- lauri Thus spaketh Anthony Tuininga on 10/02/2006 09:18 AM: > Could someone please reply to this e-mail indicating they received it. > I've just received a couple of bounce messages for two of my latest > posts. > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users |
From: Paul M. <p.f...@gm...> - 2006-10-05 15:05:19
|
On 10/2/06, Anthony Tuininga <ant...@gm...> wrote: > Could someone please reply to this e-mail indicating they received it. > I've just received a couple of bounce messages for two of my latest > posts. Yes, I can see it. Paul. |
From: Dale S. <DS...@al...> - 2006-10-05 14:42:23
|
Received it -----Original Message----- From: cx-...@li... [mailto:cx-...@li...] On Behalf Of Anthony Tuininga Sent: Monday, October 02, 2006 10:19 AM To: cx-...@li... Subject: Re: [cx-oracle-users] Calling function returning INTEGER Could someone please reply to this e-mail indicating they received it. I've just received a couple of bounce messages for two of my latest posts. ------------------------------------------------------------------------ - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D= DEVDE V _______________________________________________ cx-oracle-users mailing list cx-...@li... https://lists.sourceforge.net/lists/listinfo/cx-oracle-users |
From: Laurelin of M. E. <la...@fn...> - 2006-10-04 13:54:07
|
Unfortunately, this won't work for the case I'm trying to solve because the connection that is given to me is (and must remain) a cx_Oracle.Connection. No matter how I wrap it and mungle it at my end, the connection that the caller has passed me *is* the connection. If I change it or reconnect, then essentially I am using a *new*, separate connection, and the caller still has its dead connection. Unless the cx_Oracle.Connection instance knows how to reconnect itself.... Thanks, lauri Thus spaketh Amaury Forgeot d'Arc on 10/04/2006 03:22 AM: > [snippage] > > A solution could be to wrap both classes (connection and cursor) > inside "RetryingConnection", "RetryingCursor" classes. They delegate > all calls to their base objects, but the RetryingConnection.cursor() > function returns a wrapped RetryingCursor. ... |
From: Amaury F. d'A. <ama...@gm...> - 2006-10-04 08:24:39
|
(the mailing list seems to reject all my messages That's why I send this directly to you) James Reese wrote: > Hi, > > I'm using the cx_Oracle cursor method callfunc() to call an Oracle > function that returns type INTEGER. Is there any way to get callfunc > () to return a Python integer value instead of a float? I suppose that you wrote cursor.callfunc("myFunc", cx_Oracle.NUMBER) If you pass a variable object instead of the variable type, you may force it to return integer values: var = cursor.var(cxOracle.NUMBER) var.setvalue(0, 0) # sets the value to an int, this forces the variable's return type cursor.callfunc("myFunc", var) But AFAIK there is no automatic detection of the Oracle function's return type. Hope this helps > I apologize if the answer to this is well-known. I don't think so... -- Amaury Forgeot d'Arc |
From: Amaury F. d'A. <ama...@gm...> - 2006-10-04 08:22:32
|
(the mailing list seems to reject all my messages. That's why I send this directly to you) 2006/9/28, Laurelin of Middle Earth <la...@fn...> wrote: > Hello, > > Is it possible for a cx_Oracle.Connection to be told to "reconnect"? > .... > > But the situation I'm facing now is: client establishes their > cx_Oracle.Connection instance (and the assocated cx_Oracle.Cursor). > Some time later, the database is "bounced", and that connection is no > longer good. The RetryHandler recognizes the "not connected to > Oracle" exception, but what to do with it? > > The RetryHandler has been given a cursor object (with its connection), > and cannot "replace" that cursor/connection with a different instance. > But it would be nice to tell that cursor/connection to "try to connect > yourself again from scratch, as if you were new, but within the existing > instance at the existing address". > > Is this possible? Or am I reaching for the moon? A solution could be to wrap both classes (connection and cursor) inside "RetryingConnection", "RetryingCursor" classes. They delegate all calls to their base objects, but the RetryingConnection.cursor() function returns a wrapped RetryingCursor. RetryingCursor contains a reference to its parent RetryingConnection, in addition to its base cursor object. When a method of RetryingCursor detects an error, it asks the RetryingConnection to connect again, then recreates its cursor member. Note that some functions may be difficult to restart: if fetchone() fails in the middle of a long resultset, you have no choice but trying to fetch again the previous lines. And it's better if Variables are not involved... At least, this method should work for the plain cursor.execute() function. I hope I was clear. I tried to write some sample code, but I could not figure how your RetryHandler works. It is really an object, or a simple function? -- Amaury Forgeot d'Arc |
From: Amaury F. d'A. <ama...@gm...> - 2006-10-04 05:52:59
|
2006/9/28, Laurelin of Middle Earth wrote: > Hello, > > Is it possible for a cx_Oracle.Connection to be told to "reconnect"? > .... > > But the situation I'm facing now is: client establishes their > cx_Oracle.Connection instance (and the assocated cx_Oracle.Cursor). > Some time later, the database is "bounced", and that connection is no > longer good. The RetryHandler recognizes the "not connected to > Oracle" exception, but what to do with it? > > The RetryHandler has been given a cursor object (with its connection), > and cannot "replace" that cursor/connection with a different instance. > But it would be nice to tell that cursor/connection to "try to connect > yourself again from scratch, as if you were new, but within the existing > instance at the existing address". > > Is this possible? Or am I reaching for the moon? A solution could be to wrap both classes (connection and cursor) inside "RetryingConnection", "RetryingCursor" classes. They delegate all calls to their base objects, but the RetryingConnection.cursor() function returns a wrapped RetryingCursor. RetryingCursor contains a reference to its parent RetryingConnection, in addition to its base cursor object. When a method of RetryingCursor detects an error, it asks the RetryingConnection to connect again, then recreates its cursor member. Note that some functions may be difficult to restart: if fetchone() fails in the middle of a long resultset, you have no choice but trying to fetch again the previous lines. And it's better if Variables are not involved... At least, this method should work for the plain cursor.execute() function. I hope I was clear. I tried to write some sample code, but I could not figure how your RetryHandler works. It is really an object, or a simple function? -- Amaury Forgeot d'Arc |
From: Anthony T. <ant...@gm...> - 2006-10-04 04:25:59
|
Could someone please reply to this e-mail indicating they received it. I've just received a couple of bounce messages for two of my latest posts. |
From: Amaury F. d'A. <ama...@gm...> - 2006-10-04 02:38:14
|
James Reese wrote: > Hi, > > I'm using the cx_Oracle cursor method callfunc() to call an Oracle > function that returns type INTEGER. Is there any way to get callfunc > () to return a Python integer value instead of a float? I suppose that you wrote cursor.callfunc("myFunc", cx_Oracle.NUMBER) If you pass a variable object instead of the variable type, you may force it to return integer values: var = cursor.var(cxOracle.NUMBER) var.setvalue(0, 0) # sets the value to an int, this forces the variable's return type cursor.callfunc("myFunc", var) But AFAIK there is no automatic detection of the Oracle function's return type. Hope this helps > I apologize if the answer to this is well-known. I don't think so... -- Amaury Forgeot d'Arc |
From: Laurelin of M. E. <la...@fn...> - 2006-09-28 14:58:39
|
Hello, Is it possible for a cx_Oracle.Connection to be told to "reconnect"? Here is the situation: We have written client code that uses cx_Oracle to call various pl/sql package methods. All cx_Oracle calls to the "real" database (callproc, callfunc, execute, fetchXXX, etc.) are wrapped in a RetryHandler object. The RetryHandler can recognize certain Well Known Situations and retry the call -- example is that somebody has recompiled (or is in the process of recompiling) the PL/SQL package and its associated underlying implementations. In this case, the RetryHandler recognizes the "existing state of packages has been discarded" exception, waits a bit, and retries. This works nicely. But the situation I'm facing now is: client establishes their cx_Oracle.Connection instance (and the assocated cx_Oracle.Cursor). Some time later, the database is "bounced", and that connection is no longer good. The RetryHandler recognizes the "not connected to Oracle" exception, but what to do with it? The RetryHandler has been given a cursor object (with its connection), and cannot "replace" that cursor/connection with a different instance. But it would be nice to tell that cursor/connection to "try to connect yourself again from scratch, as if you were new, but within the existing instance at the existing address". Is this possible? Or am I reaching for the moon? Thanks in advance, lauri -- lauri loebel carpenter computing grunt fermilab la...@fn... |
From: James R. <jre...@ve...> - 2006-09-27 18:47:32
|
Hi, I'm using the cx_Oracle cursor method callfunc() to call an Oracle function that returns type INTEGER. Is there any way to get callfunc () to return a Python integer value instead of a float? I apologize if the answer to this is well-known. I'm a newbie at this stuff. Jim |
From: Anthony T. <ant...@gm...> - 2006-09-26 23:19:27
|
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 additional type (NCLOB) to handle CLOBs that use the national character set as requested by Chris Dunscombe. 2) Added support for returning cursors from functions as requested by Daniel Steinmann. 3) Added support for getting/setting the "get" mode on session pools as requested by Anand Aiyer. 4) Added support for binding subclassed cursors. 5) Fixed binding of decimal objects with absolute values less than 0.1. |
From: Amaury F. d'A. <ama...@gm...> - 2006-09-23 21:35:57
|
2006/9/23, Aaron Heinrich <ne...@gm...>: > Hello All, > > Using cx_Oracle, I'm trying to establish a connection to a remote database. I tried to deploy my tool on a terminal without any kind of Oracle client software. While I run Oracle client software on my machine, I'd prefer to not have to deploy Oracle client on any terminal wishing to use this tool. As I read through the mailing list, a similar question was posed, but I don't know if a client solution was ever included into cx_Oracle ... > > The other proposed solution included using the OIC. If cx_Oracle has no alternative, I'll make use of this, but I just wanted to see if anyone had a brighter idea. I am using a w32 environment, connecting to Oracle 9i DB > To my knowledge, any connection to an Oracle database requires one of these three components : - a regular Oracle client installation - Oracle Instant Client - the Oracle JDBC "Thin" driver. This one has no chance to work with cx_Oracle. On Windows at least, it's very easy to use the Oracle Instant Client with cx_Oracle: just copy the 3 needed Dlls in the same directory as cx_Oracle.pyd ! And no need to change setup.py: the standard distribution should work as is. Hope this helps, -- Amaury Forgeot d'Arc |
From: Aaron H. <ne...@gm...> - 2006-09-23 00:16:57
|
Hello All, Using cx_Oracle, I'm trying to establish a connection to a remote database. I tried to deploy my tool on a terminal without any kind of Oracle client software. While I run Oracle client software on my machine, I'd prefer to not have to deploy Oracle client on any terminal wishing to use this tool. As I read through the mailing list, a similar question was posed, but I don't know if a client solution was ever included into cx_Oracle Re: http://sourceforge.net/mailarchive/forum.php?thread_id=8719369&forum_id=34464: From: Anthony Tuininga <anthony.tuininga@gm...> Re: Minimum client requirements for cx_Oracle<http://sourceforge.net/mailarchive/message.php?msg_id=13558142> 2005-10-21 06:57 I can definitely add something like that to the setup.py that comes with cx_Oracle. If anyone on this list has done the same thing with Windows and Cygwin I'd like to know the changes needed for those platforms. The other proposed solution included using the OIC. If cx_Oracle has no alternative, I'll make use of this, but I just wanted to see if anyone had a brighter idea. I am using a w32 environment, connecting to Oracle 9i DB Thank you, Aaron H. -- Vi Veri Veniversum Vivus Vici |
From: Laurelin of M. E. <la...@fn...> - 2006-09-20 17:42:45
|
Thank you very much, that did the trick! Yours in gratitude, lauri Thus spaketh Steinmann Daniel on 09/20/2006 03:37 AM: > On Tuesday, September 19, 2006 10:47 PM, Laurelin of Middle Earth wrote: > > >>Does anybody have "recent information" about how to get >>whatever-it-is- that-is-needed-in-the-simplest-way so that I have the >>OCI "stuff" needed by cx_Oracle so that I can build it myself? > > > 1. Download OracleXE: > > $ echo $ORACLE_HOME > c:/programs/oraclexe/app/oracle/product/10.2.0/server > > > 2. Install cygwin version of gcc and python: > > $ gcc --version > gcc (GCC) 3.4.4 (cygming special) (gdc 0.12, using dmd 0.125) > Copyright (C) 2004 Free Software Foundation, Inc. > This is free software; see the source for copying conditions. There is > NO > warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR > PURPOSE. > > $ python > Python 2.4.3 (#1, May 18 2006, 07:40:45) > [GCC 3.3.3 (cygwin special)] on cygwin > Type "help", "copyright", "credits" or "license" for more information. > > > > 3. Download cx_Oracle-4.2 and build/install it: > > $ python setup.py build > $ python setup.py install > > Done! > > It works out of the box for me. > > Daniel > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users |