summaryrefslogtreecommitdiff
path: root/project2/tablepatch.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'project2/tablepatch.cpp')
-rw-r--r--project2/tablepatch.cpp13
1 files changed, 4 insertions, 9 deletions
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);
}
}