

def testBindStringArrayDirect(self):
    'test binding in a string array'
    returnValue = self.cursor.var(cx_Oracle.NUMBER)
    array = [r[1] for r in self.rawData]
    statement = '\n                begin\n                  :p_ReturnValue := pkg_TestStringArrays.TestInArrays(\n                      :p_IntegerValue, :p_Array);\n                end;'
    self.cursor.execute(statement, p_ReturnValue=returnValue, p_IntegerValue=5, p_Array=array)
    self.failUnlessEqual(returnValue.getvalue(), 86)
    array = [('String - %d' % i) for i in range(15)]
    self.cursor.execute(statement, p_IntegerValue=8, p_Array=array)
    self.failUnlessEqual(returnValue.getvalue(), 163)

dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/cx_Oracle-5.1.2/test/StringVar.py TestStringVar.testBindStringArrayDirect/original