27 Error(
"initResultSet",
"construction: empty statement");
31 if (stmt->status() == Statement::RESULT_SET_AVAILABLE) {
33 fResult = stmt->getResultSet();
34 fFieldInfo = (fResult==0) ? 0 :
new vector<MetaData>(fResult->getColumnListMetaData());
35 fFieldCount = (fFieldInfo==0) ? 0 : fFieldInfo->size();
36 }
else if (stmt->status() == Statement::UPDATE_COUNT_AVAILABLE) {
41 fUpdateCount = stmt->getUpdateCount();
43 }
catch (SQLException &oraex) {
44 Error(
"initResultSet",
"%s", (oraex.getMessage()).c_str());
65 if (fResult) ProducePool();
82 if (!tableName || !conn) {
83 Error(
"TOracleResult",
"construction: empty input parameter");
85 MetaData connMD = conn->getMetaData(tableName, MetaData::PTYPE_TABLE);
86 fFieldInfo =
new vector<MetaData>(connMD.getVector(MetaData::ATTR_LIST_COLUMNS));
87 fFieldCount = fFieldInfo->size();
105 if (fConn && fStmt) {
106 if (fResult) fStmt->closeResultSet(fResult);
107 fConn->terminateStatement(fStmt);
131 if (field < 0 || field >= fFieldCount) {
132 Error(
"IsValid",
"field index out of bounds");
153 fNameBuffer = (*fFieldInfo)[field].getString(MetaData::ATTR_NAME);
154 return fNameBuffer.c_str();
163 if (!fResult || (fResultType!=1))
return 0;
167 if (row!=0) fPool->Remove(row);
173 if (fResult->next() != oracle::occi::ResultSet::END_OF_FETCH) {
178 }
catch (SQLException &oraex) {
179 Error(
"Next",
"%s", (oraex.getMessage()).c_str());
189 if (!fResult)
return 0;
200 if (fPool!=0)
return;
204 while ((res = Next()) !=0) {
TOracleResult(const TOracleResult &)
const char * GetFieldName(Int_t field)
Get name of specified field.
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.
ClassImp(TOracleResult) void TOracleResult
Oracle query result.
void Error(const char *location, const char *msgfmt,...)
TSQLRow * Next()
Get next query result row.
typedef void((*Func_t)())
virtual void Add(TObject *obj)
virtual Int_t GetRowCount() const
Int_t GetFieldCount()
Get number of fields in result.
~TOracleResult()
Cleanup Oracle query result.