[Pyrex] Can pyrex codes call python objects/methods such as String, re, datetime, os diretively
liangxing
liangxing at made-in-china.com
Tue Jul 3 00:43:17 UTC 2007
Thanks for your hands.
I was looking for one alternative to get access to my oracle database. But however, I fail to find any thing better than cx_Oracle in terms of supporting my needs.
By the way, do anyone think it is an abstacle of looping timing. That is, should I replace current 'loop structure' with some stuff else.
Once I thought if I choose the __iter__ attributes, and using xx.next() to implement the function.
Is it a good idea or even worse?
as:
iter = x.__iter__() # get iterator
try:
while 1:
y = iter.next() # get each item
-----原始邮件-----
发件人: Greg Ewing [mailto:greg.ewing at canterbury.ac.nz]
发送时间: 2007年7月3日 6:27
收件人: liangxing
抄送: pyrex at lists.copyleft.no
主题: Re: [Pyrex] Can pyrex codes call python objects/methods such as String, re, datetime, os diretively
liangxing wrote:
> My case is retrieveling all record items from a Oracle Database,
> within a loop execution. By calling cursor.fetchmany() multi-times,
> I found it is quite slow.
Since the Oracle interface is probably returning an
ordinary Python list of tuples, there's not much you
can do to speed it up.
To get a substantial gain using Pyrex, you would
need to bypass the Python interface and use whatever
C interface Oracle provides directly.
--
Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury, | Carpe post meridiem! |
Christchurch, New Zealand | (I'm not a morning person.) |
greg.ewing at canterbury.ac.nz +--------------------------------------+
More information about the Pyrex
mailing list