Any and DynamicAny binding/extraction

This commit is contained in:
Aleksandar Fabijanic
2007-10-31 01:29:21 +00:00
parent 76221cc707
commit e7ac6e383c
28 changed files with 773 additions and 159 deletions

View File

@@ -1082,6 +1082,38 @@ void ODBCDB2Test::testAsync()
}
void ODBCDB2Test::testAny()
{
if (!_pSession) fail ("Test not available.");
for (int i = 0; i < 8;)
{
recreateAnysTable();
_pSession->setFeature("autoBind", bindValues[i]);
_pSession->setFeature("autoExtract", bindValues[i+1]);
_pExecutor->any();
i += 2;
}
}
void ODBCDB2Test::testDynamicAny()
{
if (!_pSession) fail ("Test not available.");
for (int i = 0; i < 8;)
{
recreateAnysTable();
_pSession->setFeature("autoBind", bindValues[i]);
_pSession->setFeature("autoExtract", bindValues[i+1]);
_pExecutor->dynamicAny();
i += 2;
}
}
void ODBCDB2Test::dropObject(const std::string& type, const std::string& name)
{
try
@@ -1182,6 +1214,15 @@ void ODBCDB2Test::recreateVectorsTable()
}
void ODBCDB2Test::recreateAnysTable()
{
dropObject("TABLE", "Anys");
try { *_pSession << "CREATE TABLE Anys (i0 INTEGER, flt0 FLOAT, str0 VARCHAR(30))", now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail ("recreateAnysTable()"); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail ("recreateAnysTable()"); }
}
void ODBCDB2Test::recreateNullsTable(const std::string& notNull)
{
dropObject("TABLE", "NullTest");
@@ -1338,6 +1379,8 @@ CppUnit::Test* ODBCDB2Test::suite()
CppUnit_addTest(pSuite, ODBCDB2Test, testNull);
CppUnit_addTest(pSuite, ODBCDB2Test, testRowIterator);
CppUnit_addTest(pSuite, ODBCDB2Test, testAsync);
CppUnit_addTest(pSuite, ODBCDB2Test, testAny);
CppUnit_addTest(pSuite, ODBCDB2Test, testDynamicAny);
return pSuite;
}