34 string& pStatementName
38 if (
nullptr == pStatement) {
41 pStatement = aEnvironment->createStatementPtr(
42 DBStatementCatalog::aInstance->getStatementRef(pStatementName)
46 setLastError(aEnvironment->lastErrorRef());
53 setLastError(e.
what());
62 void QueryRunner::storeData(
string& pDestination,
string& pStatementName) {
64 if (pStatementName.substr(0,5) ==
"SYNC-") {
66 string& vSyncPath = aEnvironment->syncPathRef();
69 TimeTool::epoch(vEpochStr);
71 vEpochStr +=
"-" + to_string(aEnvironment->id()) +
"-" + pStatementName;
72 string vSeparator =
"";
73 if (vSyncPath.back()!=
'/') {
77 string vFileName = vSyncPath + vSeparator + vEpochStr;
79 fstream vFile(vFileName.c_str(),ios::out);
83 fstream vFlag(vFileName.c_str(),ios::out);
90 void QueryRunner::storeData(
string& pDestination,
string& pStatementName,
DBParameters& pParametersRef) {
92 if (pStatementName.substr(0,5) ==
"SYNC-") {
94 string& vSyncPath = aEnvironment->syncPathRef();
97 TimeTool::epoch(vEpochStr);
99 vEpochStr +=
"-" + to_string(aEnvironment->id()) +
"-" + pStatementName;
100 string vSeparator =
"";
101 if (vSyncPath.back()!=
'/') {
105 string vFileName = vSyncPath + vSeparator + vEpochStr;
107 fstream vFile(vFileName.c_str(),ios::out);
110 vFile << vParameter.first <<
"=" << vParameter.second << endl;
114 vFileName +=
"-flag";
115 fstream vFlag(vFileName.c_str(),ios::out);
122 QueryRunner::QueryRunner(
152 string pStatementName,
165 if (
nullptr != vStatement) {
168 int vQty = vStatement->
cycleQuery(pParametersRef,pCycleRunnerRef);
202 string pStatementName,
215 if (
nullptr != vStatement) {
217 int vQty = vStatement->
cycleQuery(pParametersRef,vCycle);
252 string pStatementName,
263 if (
nullptr != vStatement) {
265 if (-1 == vStatement->
cycleQuery(pCycleRunnerRef)) {
291 string pStatementName,
304 if (
nullptr != vStatement) {
306 int vQty = vStatement->
cycleQuery(pParametersRef,pFunction);
338 string pStatementName,
349 if (
nullptr != vStatement) {
352 if (-1 == vStatement->
cycleQuery(pFunction)) {