Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

BadHardwareTableMaker.cxx File Reference

#include "BadHardwareTableMaker.h"
#include "DatabaseInterface/DbiWriter.h"
#include "DatabaseInterface/DbiTableProxyRegistry.h"
#include "DatabaseInterface/DbiCascader.h"

Go to the source code of this file.

Functions

 CVSID (" $Id: BadHardwareTableMaker.cxx,v 1.2 2005/05/19 17:44:12 tagg Exp $")
void CreateTables (const std::string &tablename)


Function Documentation

void CreateTables const std::string &  tablename  ) 
 

Definition at line 8 of file BadHardwareTableMaker.cxx.

References DbiCascader::CreateStatement(), DbiStatement::ExecuteUpdate(), Form(), DbiTableProxyRegistry::GetCascader(), DbiTableProxyRegistry::Instance(), MSG, and s().

Referenced by BadHardwareTableMaker::Write().

00009 {
00010   MSG("Morgue",Msg::kWarning) << "Creating " << tablename << " BadHardware table." << endl;
00011   int  dbNo = 0; // or whatever cascade entry you need
00012   DbiStatement* s = DbiTableProxyRegistry::Instance()
00013     .GetCascader()
00014     .CreateStatement(dbNo);
00015   
00016   
00017   s->ExecuteUpdate(Form("create table if not exists %sVLD ("
00018                         " SEQNO         int not null primary key auto_increment,"
00019                         " TIMESTART     datetime not null,"
00020                         " TIMEEND       datetime not null,"
00021                         " DETECTORMASK  tinyint,"
00022                         " SIMMASK       tinyint,"
00023                         " TASK          int,"
00024                         " AGGREGATENO   int,"
00025                         " CREATIONDATE  datetime not null,"
00026                         " INSERTDATE    datetime not null )",
00027                         tablename.c_str()));
00028 
00029   s->ExecuteUpdate(Form("create table if not exists %s ("
00030                         " SEQNO   integer,"
00031                         " TYPE    integer,"
00032                         " ID      integer, "
00033                         " START   integer, "
00034                         " STOP    integer, "
00035                         " BADNESS integer, "
00036                         " REASON  text,"
00037                         " index (SEQNO))", 
00038                         tablename.c_str()));
00039 }

CVSID " $Id: BadHardwareTableMaker cxx,
v 1.2 2005/05/19 17:44:12 tagg Exp $" 
 


Generated on Mon Feb 15 11:07:53 2010 for loon by  doxygen 1.3.9.1