#include #include int main(void) { //test data std::string datetimes[] = { "6 Dec 2001 12:33:45" , "06.12.2001 12:33:46" , "2001-12-06 12 33 47"}; std::string formats[] = { "%d %b %Y %H:%M:%S" , "%d.%m.%Y %H:%M:%S" , "%Y-%m-%d %H %M %S" }; mcsapi::ColumnStoreDriver* driver = nullptr; mcsapi::ColumnStoreBulkInsert* bulk = nullptr; try { driver = new mcsapi::ColumnStoreDriver(); bulk = driver->createBulkInsert("test", "dt", 0, 0); for (int i=0; i<(sizeof(datetimes)/sizeof(datetimes[0])) && i<(sizeof(formats)/sizeof(formats[0])); i++){ std::cout << "trying to inject datetime '" << datetimes[i] << "' with format '" << formats[i] << "'" << std::endl; mcsapi::ColumnStoreDateTime dt = mcsapi::ColumnStoreDateTime(datetimes[i], formats[i]); bulk->setColumn(0,dt); bulk->writeRow(); std::cout << "injection successfull" << std::endl; } bulk->commit(); } catch (std::exception &e) { std::cout << "Error caught: " << e.what() << std::endl; } delete bulk; delete driver; }