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();
83 if (!tableName || !conn) {
84 Error(
"TOracleResult",
"construction: empty input parameter");
86 MetaData connMD = conn->getMetaData(tableName, MetaData::PTYPE_TABLE);
87 fFieldInfo =
new vector<MetaData>(connMD.getVector(MetaData::ATTR_LIST_COLUMNS));
88 fFieldCount = fFieldInfo->size();
106 if (fConn && fStmt) {
107 if (fResult) fStmt->closeResultSet(fResult);
108 fConn->terminateStatement(fStmt);
132 if (field < 0 || field >= fFieldCount) {
133 Error(
"IsValid",
"field index out of bounds");
154 fNameBuffer = (*fFieldInfo)[field].getString(MetaData::ATTR_NAME);
155 return fNameBuffer.c_str();
164 if (!fResult || (fResultType!=1))
return 0;
168 if (row!=0) fPool->Remove(row);
174 if (fResult->next() != oracle::occi::ResultSet::END_OF_FETCH) {
179 }
catch (SQLException &oraex) {
180 Error(
"Next",
"%s", (oraex.getMessage()).c_str());
190 if (!fResult)
return 0;
201 if (fPool!=0)
return;
205 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.
virtual Int_t GetRowCount() const
void initResultSet(oracle::occi::Statement *stmt)
Oracle query result.
Bool_t IsValid(Int_t field)
Check if result set is open and field index within range.
void Error(const char *location, const char *msgfmt,...)
TSQLRow * Next()
Get next query result row.
virtual void Add(TObject *obj)
Int_t GetFieldCount()
Get number of fields in result.
~TOracleResult()
Cleanup Oracle query result.