summaryrefslogtreecommitdiff
path: root/libodbcpp/selectcommand.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libodbcpp/selectcommand.cpp')
-rw-r--r--libodbcpp/selectcommand.cpp13
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();