diff options
author | randomdan <randomdan@localhost> | 2010-04-02 01:05:25 +0000 |
---|---|---|
committer | randomdan <randomdan@localhost> | 2010-04-02 01:05:25 +0000 |
commit | 1ede41e012f7363a0d2804e70be0f6c772997e82 (patch) | |
tree | 86671e425d8f66fa16ce1989dbdc4fac45853295 /libodbcpp/selectcommand.cpp | |
parent | Lots of little fixes (diff) | |
download | libdbpp-odbc-1ede41e012f7363a0d2804e70be0f6c772997e82.tar.bz2 libdbpp-odbc-1ede41e012f7363a0d2804e70be0f6c772997e82.tar.xz libdbpp-odbc-1ede41e012f7363a0d2804e70be0f6c772997e82.zip |
lots of gcc warning fixes and a few newbies
Diffstat (limited to 'libodbcpp/selectcommand.cpp')
-rw-r--r-- | libodbcpp/selectcommand.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libodbcpp/selectcommand.cpp b/libodbcpp/selectcommand.cpp index 9d385b9..92b4077 100644 --- a/libodbcpp/selectcommand.cpp +++ b/libodbcpp/selectcommand.cpp @@ -153,6 +153,19 @@ ODBC::SelectCommand::operator[](const String & colName) const } unsigned int +ODBC::SelectCommand::getOrdinal(const String & colName) const +{ + unsigned int n = 0; + for (Columns::const_iterator col = columns.begin(); col != columns.end(); col++) { + if ((*col)->name == colName) { + return n; + } + n += 1; + } + throw ODBC::Error("Column (%s) does not exist", colName.c_str()); +} + +unsigned int ODBC::SelectCommand::columnCount() const { return columns.size(); |