I have table like:
CREATE TABLE `table_name` (
`id` int unsigned NOT NULL AUTO_INCREMENT,
`date_update` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
I have C++ code:
RowResult res = mysession.sql("SELECT id, date_update FROM table_name").execute();
Row row;
while ((row = res.fetchOne())) {
cout << "Id: " << row[0] << endl; // Ok
std::string data_update = row[1]; // How to get datetime here?
// row[1].getType() == Type::Document(8)
}
row[1] - is variable with type mysqlx::Value with type Document.
How should i read field date_update?
CREATE TABLE `table_name` (
`id` int unsigned NOT NULL AUTO_INCREMENT,
`date_update` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
I have C++ code:
RowResult res = mysession.sql("SELECT id, date_update FROM table_name").execute();
Row row;
while ((row = res.fetchOne())) {
cout << "Id: " << row[0] << endl; // Ok
std::string data_update = row[1]; // How to get datetime here?
// row[1].getType() == Type::Document(8)
}
row[1] - is variable with type mysqlx::Value with type Document.
How should i read field date_update?