本文整理汇总了C++中SQLStatement::bind方法的典型用法代码示例。如果您正苦于以下问题:C++ SQLStatement::bind方法的具体用法?C++ SQLStatement::bind怎么用?C++ SQLStatement::bind使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SQLStatement
的用法示例。
在下文中一共展示了SQLStatement::bind方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: temp
void
Repeater::do_load()
{
SQLStatement statement
( database_connection(),
"select interval_units, interval_type_id, next_date, journal_id "
"from repeaters where repeater_id = :p"
);
statement.bind(":p", id());
statement.step();
Repeater temp(*this);
temp.m_data->frequency = Frequency
( statement.extract<int>(0),
static_cast<IntervalType>(statement.extract<int>(1))
);
temp.m_data->next_date =
numeric_cast<DateRep>(statement.extract<long long>(2));
temp.m_data->journal_id = statement.extract<Id>(3);
swap(temp);
JEWEL_ASSERT
( is_valid_date_for_interval_type
( boost_date_from_julian_int(value(m_data->next_date)),
value(m_data->frequency).step_type()
)
);
return;
}
示例2: value
void
Repeater::process_saving_statement(SQLStatement& statement)
{
Frequency const freq = value(m_data->frequency);
JEWEL_ASSERT
( is_valid_date_for_interval_type
( boost_date_from_julian_int(value(m_data->next_date)),
freq.step_type()
)
);
statement.bind(":interval_units", freq.num_steps());
statement.bind
( ":interval_type_id",
static_cast<int>(freq.step_type())
);
statement.bind(":next_date", value(m_data->next_date));
statement.bind(":journal_id", value(m_data->journal_id));
statement.step_final();
return;
}
示例3: id
void
Repeater::do_save_existing()
{
SQLStatement updater
( database_connection(),
"update repeaters set "
"interval_units = :interval_units, "
"interval_type_id = :interval_type_id, "
"next_date = :next_date, "
"journal_id = :journal_id "
"where repeater_id = :repeater_id"
);
updater.bind(":repeater_id", id());
process_saving_statement(updater);
return;
}