Thread: [cx-oracle-users] Calling function returning INTEGER
Brought to you by:
atuining
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: 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: 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: 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: 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: 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: 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: 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 > |