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