Mysql connector c++ 8.0. How to work with datetime?
Posted by:
e s
Date: January 22, 2020 08:24AM
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?
Subject
Views
Written By
Posted
Mysql connector c++ 8.0. How to work with datetime?
1595
January 22, 2020 08:24AM
882
January 22, 2020 03:23PM
707
January 23, 2020 12:54AM
801
January 23, 2020 08:15AM
1096
January 23, 2020 10:48AM
769
January 24, 2020 10:52AM
1074
January 25, 2020 03:15AM
1322
January 27, 2020 09:46AM
760
January 31, 2020 12:43PM
671
March 14, 2020 10:07AM
912
March 17, 2020 11:28AM
684
April 29, 2020 10:49AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.