我正在尝试使用 Documentum API 计算平均值,如下所示:
final IDfQuery checkMediaDocs = (IDfQuery) new DfQuery();
IDfCollection mediaDocs = null;
checkMediaDocs.setDQL("select sum(tot_doc_daily)/count(*) as mediaglobale from my_table");
mediaDocs = checkTodayDocs.execute(session, IDfQuery.DF_READ_QUERY);
int media = 0;
while (mediaDocs.next()) {
media = (int) mediaDocs.getDouble("mediaglobale");
}
但是,应用程序不工作,返回此错误:
101884 [SchedulerFactoryBean_Worker-1] ERROR it.reply.square.isa.daemon.DatExporterWorker - [DM_API_E_BADATTRNAME]error: "Bad attribute name 'mediaglobale' for document/object."
DfTypedObjectException:: THREAD: SchedulerFactoryBean_Worker-1; MSG: [DM_API_E_BADATTRNAME]error: "Bad attribute name 'mediaglobale' for document/object."; ERRORCODE: 100; NEXT: null
at com.documentum.fc.client.impl.typeddata.LiteType.getAttr(LiteType.java:171)
at com.documentum.fc.client.impl.typeddata.LiteType.getAttrIndex(LiteType.java:226)
at com.documentum.fc.client.impl.typeddata.AbstractTypedData.getAttrIndex(AbstractTypedData.java:697)
at com.documentum.fc.client.impl.typeddata.AbstractTypedData.get(AbstractTypedData.java:129)
at com.documentum.fc.client.impl.typeddata.AbstractTypedData.getString(AbstractTypedData.java:159)
at com.documentum.fc.client.DfTypedObject.getStringRaw(DfTypedObject.java:655)
at com.documentum.fc.client.DfTypedObject.doGetString(DfTypedObject.java:623)
at com.documentum.fc.client.impl.collection.TypedDataCollection.doGetString(TypedDataCollection.java:91)
如何正确检索自定义双精度值?如果“mediaglobale”是一个简单的计数,我可以用 getInt() 检索它,而不会出错:所以,这似乎是 getDouble() 的问题,这里。
谢谢。