예제 #1
0
BOOST_FIXTURE_TEST_CASE(test_time_insert_time_select, fixture) {
  using sql::select;
  test1 t;
  odbc::time write(3, 11, 17);
  db.execute(insert_into(t)(t.id, t.val).values(1, write));
  BOOST_RDB_CHECK_SELECT_RESULTS(db.execute(select(t.id, t.val).from(t)), "((1 03:11:17))");
}
예제 #2
0
BOOST_FIXTURE_TEST_CASE(test_time_bind_varchar, fixture) {

  using sql::select;

  test1 t;

  varchar<30> write = "03:11:17";
  db.prepare(insert_into(t)(t.id, t.val).values(1, _)).bind_parameters(write).execute();

  varchar<30> read;
  db.prepare(select(t.val).from(t)).bind_results(read).execute().fetch();
  BOOST_CHECK(!read.is_null());
  BOOST_CHECK_EQUAL(read.value(), "03:11:17");
}
예제 #3
0
BOOST_FIXTURE_TEST_CASE(test_time_bind_time, fixture) {

  using sql::select;

  test1 t;
  
  odbc::time write(3, 11, 17);
  db.prepare(insert_into(t)(t.id, t.val).values(1, _)).bind_parameters(write).execute();

  odbc::time read;
  db.prepare(select(t.val).from(t)).bind_results(read).execute().fetch();
  
  BOOST_CHECK(!read.is_null());
  BOOST_CHECK_EQUAL(read.value().hour, 3);
  BOOST_CHECK_EQUAL(read.value().minute, 11);
  BOOST_CHECK_EQUAL(read.value().second, 17);
}