summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrandomdan <randomdan@localhost>2010-09-16 00:01:56 +0000
committerrandomdan <randomdan@localhost>2010-09-16 00:01:56 +0000
commitf548c8f51aa45fa9d44704dc978e2bb793f3a37c (patch)
tree003bf46c69fdc28e0a570d3696e82ea214eaecc0
parentAdd some error handling to ProcRows (diff)
downloadproject2-f548c8f51aa45fa9d44704dc978e2bb793f3a37c.tar.bz2
project2-f548c8f51aa45fa9d44704dc978e2bb793f3a37c.tar.xz
project2-f548c8f51aa45fa9d44704dc978e2bb793f3a37c.zip
Rewrite the whole of parameter and column binding almost from scratch
No more template rubbish, no more messy partial specialisation Add copyless rebind of column to parameter Changes in project2 to suit
-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);