20 #include <CoralBase/Attribute.h>
21 #include <CoralBase/AttributeList.h>
23 #include "RelationalAccess/SchemaException.h"
24 #include "RelationalAccess/ITransaction.h"
25 #include "RelationalAccess/ITable.h"
26 #include "RelationalAccess/ISchema.h"
27 #include "RelationalAccess/ICursor.h"
28 #include "RelationalAccess/IQuery.h"
39 msg() <<
"PrescaledClockLoader: Load PrescaledClock with ID = " << pcTarget.
id() << std::endl;
44 coral::ITable&
table =
m_session.nominalSchema().tableHandle(
"L1_PRESCALED_CLOCK");
46 query->setRowCacheSize( 5 );
50 bindList.extend<
long>(
"pcId");
51 std::string cond =
"L1PC_ID = :pcId";
52 bindList[0].data<
long>() = pcTarget.
id();
53 query->setCondition( cond, bindList);
57 attList.extend<std::string>(
"L1PC_NAME" );
58 attList.extend<
int>(
"L1PC_VERSION" );
59 attList.extend<
int>(
"L1PC_CLOCK1" );
60 attList.extend<
int>(
"L1PC_CLOCK2" );
61 attList.extend<
long>(
"L1PC_ID" );
62 query->defineOutput(attList);
64 query->addToOutputList(
"L1PC_NAME" );
65 query->addToOutputList(
"L1PC_VERSION" );
66 query->addToOutputList(
"L1PC_CLOCK1" );
67 query->addToOutputList(
"L1PC_CLOCK2" );
68 query->addToOutputList(
"L1PC_ID" );
69 query->addToOrderList(
"L1PC_ID" );
74 msg() <<
"PrescaledClockLoader >> No such prescaled clock exists "
75 << pcTarget.
id() << std::endl;
78 throw std::runtime_error(
"PrescaledClockLoader >> PrescaledClock not available" );
82 std::string
name =
row[
"L1PC_NAME"].data<std::string>();
84 int clock1 =
row[
"L1PC_CLOCK1"].data<
int>();
85 int clock2 =
row[
"L1PC_CLOCK2"].data<
int>();
88 msg() <<
"PrescaledClockLoader >> More than one PrescaledClock exists "
89 << pcTarget.
id() << std::endl;
92 throw std::runtime_error(
"PrescaledClockLoader >> PrescaledClock not available" );
105 }
catch(
const coral::SchemaException&
e ) {
106 msg() <<
"PrescaledClockLoader >> SchemaException: "
108 <<
e.what() << std::endl;
113 msg() <<
"PrescaledClockLoader >> Standard C++ exception: " <<
e.what() << std::endl;
119 msg() <<
"PrescaledClockLoader >> Uknown C++ exception" << std::endl;