'test preparing a statement and executing it multiple times'

def testPrepare(self):

    self.failUnlessEqual(self.cursor.statement, None)
    statement = 'begin    :value    :=    :value    +    5;    end;'
    self.cursor.prepare(statement)
    var = self.cursor.var(cx_Oracle.NUMBER)
    self.failUnlessEqual(self.cursor.statement, statement)
    var.setvalue(0, 2)
    self.cursor.execute(None, value=var)
    self.failUnlessEqual(var.getvalue(), 7)
    self.cursor.execute(None, value=var)
    self.failUnlessEqual(var.getvalue(), 12)
    self.cursor.execute('begin    :value2    :=    3;    end;', value2=var)
    self.failUnlessEqual(var.getvalue(), 3)
