summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrandomdan <randomdan@localhost>2010-11-30 21:03:08 +0000
committerrandomdan <randomdan@localhost>2010-11-30 21:03:08 +0000
commitd828614a8d8ecfff442a039620d028c7bf80ac02 (patch)
tree1eaed0ae4c00ecefefedc64ac8efda537bc771f7
parentAdd an iterator and viewer for XML documents capable of processing huge docs (diff)
downloadproject2-d828614a8d8ecfff442a039620d028c7bf80ac02.tar.bz2
project2-d828614a8d8ecfff442a039620d028c7bf80ac02.tar.xz
project2-d828614a8d8ecfff442a039620d028c7bf80ac02.zip
Support binding null to an SQL command parameter
Bind null for missing values for SQL merge data
-rw-r--r--project2/sqlMergeTask.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/project2/sqlMergeTask.cpp b/project2/sqlMergeTask.cpp
index 318ab4f..3abf4ee 100644
--- a/project2/sqlMergeTask.cpp
+++ b/project2/sqlMergeTask.cpp
@@ -216,7 +216,12 @@ class _Populate : public _NoOutputExecute {
}
unsigned int cols = iter->columnCount();
for (unsigned int c = 0; c < cols; c += 1) {
- cmd->bindParamS(idxs[c], iter->getCurrentValue(c));
+ try {
+ cmd->bindParamS(idxs[c], iter->getCurrentValue(c));
+ }
+ catch (const PerRowValues::FieldDoesNotExist &) {
+ cmd->bindNull(idxs[c]);
+ }
}
cmd->execute();
}