29 fFieldInfo = fieldMetaData;
30 fFieldCount = fFieldInfo->size();
50 if (fFieldsBuffer!=0) {
51 for (
int n=0;
n<fFieldCount;
n++)
52 if (fFieldsBuffer[
n])
delete[] fFieldsBuffer[
n];
53 delete[] fFieldsBuffer;
67 Error(
"IsValid",
"row closed");
70 if (field < 0 || field >= (
Int_t)fFieldInfo->size()) {
71 Error(
"IsValid",
"field index out of bounds");
82 if (!IsValid(field) || fFieldInfo->size() <= 0)
85 MetaData fieldMD = (*fFieldInfo)[field];
87 return fieldMD.getInt(MetaData::ATTR_DATA_SIZE);
94 if ((field<0) || (field>=fFieldCount)) {
95 Error(
"TOracleRow",
"GetField(): out-of-range or No RowData/ResultSet/MetaData");
99 return fFieldsBuffer ? fFieldsBuffer[field] : 0;
106 if (!fResult || !fFieldInfo || (fFieldCount<=0))
return;
108 fFieldsBuffer =
new char* [fFieldCount];
109 for (
int n=0;
n<fFieldCount;
n++)
110 fFieldsBuffer[
n] = 0;
114 char str_number[200];
116 int fPrecision, fScale, fDataType;
121 for (
int field=0;field<fFieldCount;field++) {
122 if (fResult->isNull(field+1))
continue;
124 fDataType = (*fFieldInfo)[field].getInt(MetaData::ATTR_DATA_TYPE);
128 fPrecision = (*fFieldInfo)[field].getInt(MetaData::ATTR_PRECISION);
129 fScale = (*fFieldInfo)[field].getInt(MetaData::ATTR_SCALE);
131 if ((fScale == 0) || (fPrecision == 0)) {
132 res = fResult->getString(field+1);
134 double_val = fResult->getDouble(field+1);
144 res = fResult->getString(field+1);
150 case SQLT_TIMESTAMP_TZ:
151 case SQLT_TIMESTAMP_LTZ:
156 res = fResult->getString(field+1);
159 Error(
"GetRowData",
"Oracle type %d was not yet tested - please inform ROOT developers", fDataType);
163 int len = res.length();
165 fFieldsBuffer[field] =
new char[len+1];
166 strcpy(fFieldsBuffer[field], res.c_str());
170 }
catch (SQLException &oraex) {
171 Error(
"GetRowData",
"%s", (oraex.getMessage()).c_str());
~TOracleRow()
Destroy row object.
static const char * GetFloatFormat()
return current printf format for float/double members, default "%e"
void Error(const char *location, const char *msgfmt,...)
TOracleRow(const TOracleRow &)
ULong_t GetFieldLength(Int_t field)
Get length in bytes of specified field.
Bool_t IsValid(Int_t field)
Check if row is open and field index within range.
const char * GetField(Int_t field)
void Close(Option_t *opt="")
Close row.
static const char * GetDatimeFormat()
return value of actul convertion format from timestamps or date to string