Import statements for timeit module

ChaosKCW da.martian at gmail.com
Fri Nov 11 08:26:58 EST 2005


Hi

I was wondering if someone could help with the import statements needed
to use the timeit module in the following code. I need to access the
"cur" object.

Thanks,

import cx_Oracle
import timeit

def VerifyTagIntegrity(con, TableOwner):
    cur = con.cursor()
    sql = 'select (select count(*) from %s.f4111) as F4111_COUNT,
(select count(*) from %s.f4111_tag) as TAG_COUNT from dual;' %
(TableOwner, TableOwner)
    print "      SQL: %s" % (sql)
    timer = timeit.Timer('cur.execute(sql)', 'from __main__ import
cur')
    print timer.timeit()




More information about the Python-list mailing list