summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--project2/sendmailTask.cpp1
-rw-r--r--project2/tablepatch.cpp13
-rw-r--r--project2/tablepatch.h2
3 files changed, 4 insertions, 12 deletions
diff --git a/project2/sendmailTask.cpp b/project2/sendmailTask.cpp
index fdc298d..dc04f49 100644
--- a/project2/sendmailTask.cpp
+++ b/project2/sendmailTask.cpp
@@ -2,7 +2,6 @@
#include <boost/foreach.hpp>
#include <stdexcept>
#include "xmlObjectLoader.h"
-#include "modifycommand.h"
#include "appEngine.h"
#include "rdbmsDataSource.h"
#include "presenter.h"
diff --git a/project2/tablepatch.cpp b/project2/tablepatch.cpp
index 3f057df..0decc1e 100644
--- a/project2/tablepatch.cpp
+++ b/project2/tablepatch.cpp
@@ -42,12 +42,6 @@ TablePatch::patch(const char * where, const char * order)
}
void
-TablePatch::copyBind(const SelectCommand * src, ModifyCommand * dest, int cola, int colb)
-{
- (*src)[cola].rebind(dest, colb);
-}
-
-void
TablePatch::doDeletes(const char * where, const char * order)
{
// -----------------------------------------------------------------
@@ -200,10 +194,11 @@ TablePatch::doUpdates(const char * where, const char * order)
SelectCommand toUpd(db, toUpdSel.c_str());
ModifyCommand upd(db, updSql.c_str());
int cs = cols.size();
+ toUpd.execute();
+ for (int c = 0; c < cs; c += 1) {
+ toUpd[c].rebind(&upd, c);
+ }
while (toUpd.fetch()) {
- for (int c = 0; c < cs; c += 1) {
- copyBind(&toUpd, &upd, c, c);
- }
upd.execute(false);
}
}
diff --git a/project2/tablepatch.h b/project2/tablepatch.h
index 533ee16..f317fd2 100644
--- a/project2/tablepatch.h
+++ b/project2/tablepatch.h
@@ -29,8 +29,6 @@ class TablePatch {
void addKey(const Column & col);
void patch(const char * where, const char * order);
- static void copyBind(const SelectCommand * src, ModifyCommand * dest, int cola, int colb);
-
private:
void doDeletes(const char * where, const char * order);
void doUpdates(const char * where, const char * order);