RowPtr SqlCursor::fetch_row() { try { RowPtr row = backend_->fetch_row(); if (row.get()) { Row::iterator j = row->begin(), jend = row->end(); for (; j != jend; ++j) { String uname = str_to_upper(j->first); using namespace std; swap(j->first, uname); } } if (echo_) { if (row.get()) { std::ostringstream out; out << "fetch: "; Row::const_iterator j = row->begin(), jend = row->end(); for (; j != jend; ++j) out << NARROW(j->first) << "=" << NARROW(j->second.sql_str()) << " "; debug(WIDEN(out.str())); } else debug(_T("fetch: no more rows")); } return row; } catch (const std::exception &e) { connection_.mark_bad(e); throw; } }
bool SqlResultSet::fetch(Row &row) { RowPtr p = cursor_.fetch_row(); if (!p.get()) return false; row.swap(*p); return true; }