Commit 10495d2f authored by Steven Murray's avatar Steven Murray
Browse files

OcciRset::columnText() now throws NullDbValue as appropriate

parent 9cf3c429
......@@ -145,7 +145,11 @@ oracle::occi::ResultSet *OcciRset::operator->() const {
std::string OcciRset::columnText(const std::string &colName) const {
try {
const int colIdx = m_colNameToIdx.getIdx(colName);
return m_rset->getString(colIdx);
const std::string stringValue = m_rset->getString(colIdx);
if(stringValue.empty()) {
throw NullDbValue(std::string("Database column ") + colName + " contains a NULL value");
}
return stringValue;
} catch(exception::Exception &ne) {
throw exception::Exception(std::string(__FUNCTION__) + " failed for SQL statement " + m_stmt.getSql() + ": " +
ne.getMessage().str());
......
......@@ -1231,7 +1231,7 @@ std::list<common::dataStructures::Tape> RdbmsCatalogue::getTapes(const TapeSearc
"LAST_UPDATE_USER_NAME AS LAST_UPDATE_USER_NAME,"
"LAST_UPDATE_HOST_NAME AS LAST_UPDATE_HOST_NAME,"
"LAST_UPDATE_TIME AS LAST_UPDATE_TIME "
"FROM "
"FROM "
"TAPE";
if(!(
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment