wxString OTLResultSet::GetFieldAsString(int nField) { ResultSetMetaData *metaData = GetMetaData(); wxString Result; switch(metaData->GetColumnType(nField)) { case ResultSetMetaData::COLUMN_INTEGER: { long lValue = GetResultLong(nField); Result = wxString::Format(wxT("%u"),lValue); break; } case ResultSetMetaData::COLUMN_DOUBLE: { double dValue = GetResultDouble(nField); Result = wxString::Format(wxT("%f"),dValue); break; } case ResultSetMetaData::COLUMN_DATE: { wxDateTime dateValue = GetResultDate(nField); if (dateValue.IsValid()) Result = dateValue.Format(); else Result = _("Invalid Date"); break; } case ResultSetMetaData::COLUMN_STRING: { std::string strV; m_readIt.get(nField,strV); Result = ConvertFromUnicodeStream(strV.c_str()); break; } default: Result = wxT(""); break; } this->CloseMetaData(metaData); wxPrintf(_("Result as string: '%s'\n"), Result.c_str()); return Result; }
bool TdsResultSet::GetResultBool(int nField) { long nValue = GetResultLong(nField); return (nValue != 0); }
// get field int TdsResultSet::GetResultInt(int nField) { return (int)GetResultLong(nField); }
// get field int wxPostgresResultSet::GetResultInt(int nField) { // Don't use nField-1 here since GetResultLong will take care of that return GetResultLong(nField); }
// get field int wxMysqlPreparedStatementResultSet::GetResultInt(int nField) { return GetResultLong(nField); }