31 if (SQLRowCount(fResult, &rowcount) != SQL_SUCCESS) {
32 Error(
"TSapDBResult",
"no rows counted");
36 fRowCount = rowcount < 0 ? rowCount : rowcount;
70 Error(
"IsValid",
"result set closed");
74 Error(
"IsValid",
"field index out of bounds");
86 Error(
"GetFieldCount",
"result set closed");
93 SQLSMALLINT columnCount;
94 if (SQLNumResultCols(
fResult, &columnCount) == SQL_SUCCESS)
117 SQLUSMALLINT columnNumber;
118 SQLCHAR columnName[256];
119 SQLSMALLINT bufferLength = 256;
120 SQLSMALLINT nameLength;
121 SQLSMALLINT dataType;
123 SQLSMALLINT decimalDigits;
124 SQLSMALLINT nullable;
126 columnNumber = field + 1;
127 if (SQLDescribeCol(
fResult, columnNumber, columnName, bufferLength,
128 &nameLength, &dataType, &columnSize, &decimalDigits,
129 &nullable) == SQL_SUCCESS) {
136 Error(
"GetFieldName",
"cannot get field info");
150 Error(
"Next",
"result set closed");
154 RETCODE rc = SQLFetchScroll(
fResult, SQL_FETCH_NEXT, 0);
155 if (rc == SQL_SUCCESS)
157 else if (rc == SQL_NO_DATA)
160 Error(
"Next",
"error during fetchscroll");
const char * GetFieldName(Int_t field)
Get name of specified field.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
void Error(const char *location, const char *msgfmt,...)
TSQLRow * Next()
Get next query result row.
Int_t GetFieldCount()
Get number of fields in result.
ClassImp(TSapDBResult) TSapDBResult
SapDB query result.
~TSapDBResult()
Cleanup SapDB query result.
void Close(Option_t *opt="")
Close query result.
Bool_t IsValid(Int_t field)
Check if result set is open and field index within range.