diff options
author | randomdan <randomdan@localhost> | 2010-04-05 17:15:14 +0000 |
---|---|---|
committer | randomdan <randomdan@localhost> | 2010-04-05 17:15:14 +0000 |
commit | b9b2dc0575ba01dd294264f217757a88cabafc62 (patch) | |
tree | 03851b0aa39cb2e5fade42e990179b9e7e127d24 /libodbcpp/param.cpp | |
parent | lots of gcc warning fixes and a few newbies (diff) | |
download | libdbpp-odbc-b9b2dc0575ba01dd294264f217757a88cabafc62.tar.bz2 libdbpp-odbc-b9b2dc0575ba01dd294264f217757a88cabafc62.tar.xz libdbpp-odbc-b9b2dc0575ba01dd294264f217757a88cabafc62.zip |
Minor fixes
Diffstat (limited to 'libodbcpp/param.cpp')
-rw-r--r-- | libodbcpp/param.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/libodbcpp/param.cpp b/libodbcpp/param.cpp index 7bfa415..53b55b5 100644 --- a/libodbcpp/param.cpp +++ b/libodbcpp/param.cpp @@ -125,11 +125,11 @@ ODBC::Command::bindParamS(unsigned int i, const unsigned char * val, size_t leng throw Error("%s: Bind out of bounds", __FUNCTION__); } void -ODBC::Command::bindParamT(unsigned int i, struct tm * val) +ODBC::Command::bindParamT(unsigned int i, const TimeTypePair & val) { if (i < params.size()) { _Param<TimeTypePair>* p = Param::makeParam<TimeTypePair>(params[i]); - p->value.set(*val); + p->value = val; if (!p->bound) { p->bind(this->hStmt, i + 1, SQL_C_TYPE_TIMESTAMP, SQL_TYPE_TIMESTAMP, sizeof(SQL_TIMESTAMP_STRUCT), 0, &p->value.sql(), sizeof(SQL_TIMESTAMP_STRUCT)); @@ -163,7 +163,7 @@ ODBC::Command::bindParamS(unsigned int i, const unsigned char * val) { const unsigned char * x = val; while (*val++) ; - bindParamS(i, val, val - x); + bindParamS(i, x, val - x); } void ODBC::Command::bindParamS(unsigned int i, const char * val) @@ -187,4 +187,9 @@ ODBC::Command::bindParamT(unsigned int i, time_t val) gmtime_r(&val, &t); bindParamT(i, &t); } +void +ODBC::Command::bindParamT(unsigned int i, const struct tm * val) +{ + bindParamT(i, TimeTypePair(*val)); +} |