I think you need to use not soci::row
for this purpose but std::string
//...
std::string firstname;
soci::statement st = (sql.prepare << "SELECT firstname FROM person;"
, soci::into(firstname, ind));
//...
case soci::i_ok:
std::cout << firstname << std::endl;
break;
//...