3 #include "RelationalAccess/ISession.h"
4 #include "RelationalAccess/ITransaction.h"
5 #include "RelationalAccess/ISchema.h"
6 #include "RelationalAccess/ITable.h"
7 #include "RelationalAccess/ITableDataEditor.h"
8 #include "RelationalAccess/TableDescription.h"
9 #include "RelationalAccess/IQuery.h"
10 #include "RelationalAccess/ICursor.h"
11 #include "CoralBase/AttributeList.h"
12 #include "CoralBase/Attribute.h"
13 #include "CoralBase/AttributeSpecification.h"
28 m_connectionString( connectionString ),
53 session->transaction().start( );
54 std::cout <<
"connected succesfully to omds" <<std::endl;
55 coral::ISchema&
schema = session->nominalSchema();
64 session->transaction().start( );
65 std::cout <<
"connected succesfully to omds" <<std::endl;
66 coral::ISchema&
schema = session->nominalSchema();
79 std::cerr <<
"Error: no such file!"<< std::endl;
84 char first_three_char[3];
89 char subsys[50],
comp[50],
tmp[3];
92 while(!indata.eof()) {
93 indata.getline(line,100);
95 for(
int k=0;
k<3;
k++){
96 first_three_char[
k]= line[
k];
99 if ( l==1 || first_three_char ==spaces)
continue;
100 if (first_three_char==Run){
102 sscanf( line,
"%s%d%s", tmp , &ItemI_tmp.
m_run , subsys);
106 sscanf( line,
"<%[^>]>%f",comp,&ItemI_tmp.
m_status );
126 std::cout<<
"read from file, and now transferring these value : " << std::endl;
135 std::cout<<
"starting to write the data in omds : " << std::endl;
138 std::cout <<
"connecting to omds" <<std::endl;
140 session->transaction().start( );
141 std::cout <<
"connected succesfully to omds" <<std::endl;
142 coral::ISchema&
schema = session->nominalSchema();
146 coral::AttributeList rowBuffer;
147 table.dataEditor().rowBuffer( rowBuffer );
153 rowBuffer[
"RUN"].data<
long long int>() =Itemtemp.
m_run ;
156 rowBuffer[
"STATUS"].data<
double>() = Itemtemp.
m_status;
157 table.dataEditor().insertRow( rowBuffer );
160 session->transaction().commit();
void writeData(const std::string &tableToRead)
std::string m_tableToAppend
std::string m_reportcontent
std::string m_tableToDrop
virtual ~WriteDQMSummaryIntoOMDS()
std::vector< Item > m_itemvec
WriteDQMSummaryIntoOMDS(const std::string &connectionString, const std::string &user, const std::string &pass)
void dropView(const std::string &view)
std::vector< Item > readData(const std::string &file)
void dropTable(const std::string &table)
std::vector< std::vector< double > > tmp
std::string m_connectionString
coral::ISession * connect(const std::string &connectionString, const std::string &user, const std::string &password)