From 1ede41e012f7363a0d2804e70be0f6c772997e82 Mon Sep 17 00:00:00 2001 From: randomdan Date: Fri, 2 Apr 2010 01:05:25 +0000 Subject: lots of gcc warning fixes and a few newbies --- libodbcpp/selectcommand.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'libodbcpp/selectcommand.cpp') diff --git a/libodbcpp/selectcommand.cpp b/libodbcpp/selectcommand.cpp index 9d385b9..92b4077 100644 --- a/libodbcpp/selectcommand.cpp +++ b/libodbcpp/selectcommand.cpp @@ -152,6 +152,19 @@ ODBC::SelectCommand::operator[](const String & colName) const throw ODBC::Error("Column (%s) does not exist", colName.c_str()); } +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 { -- cgit v1.2.3