We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Write the code as follows, please focus on the roll_change_times variable.
void rollchan(std::vector<ocilib::ostring>& roll_ids, std::vector<ocilib::Date> roll_change_times, std::vector<float>& roll_diameters, std::vector<ocilib::ostring>& roll_locations, std::vector<ocilib::ostring>& roll_kinds) { try { auto& db = DB::OracleDB::OracleConnectionPool::getOracleInstance(); auto conn = db.getConnection(); const int StrMaxSize = 20; ocilib::Statement stmt(conn); //conn.SetAutoCommit(true); stmt.Prepare("INSERT INTO ROLL_CHANGES (ROLL_ID,ROLL_LOCATION,ROLL_KIND,ROLL_DIAMETER,ROLL_CHANGE_TIME) VALUES (:ids,:locs,:kinds,:dia,:time)"); stmt.SetBindArraySize(roll_ids.size()); stmt.Bind(":ids", roll_ids, StrMaxSize, ocilib::BindInfo::In); stmt.Bind(":locs", roll_locations, StrMaxSize, ocilib::BindInfo::In); stmt.Bind(":kinds", roll_kinds, StrMaxSize, ocilib::BindInfo::In); stmt.Bind(":dia", roll_diameters, ocilib::BindInfo::In); stmt.Bind(":time", roll_change_times, ocilib::BindInfo::In); stmt.ExecutePrepared(); conn.Commit(); std::cout << "row processed : " << stmt.GetAffectedRows() << std::endl; } catch (const std::exception& e) { cerr << "err: " << e.what() << endl; } } //main std::vector<ocilib::ostring> roll_ids{ "1","3","2","4" }; std::vector<ocilib::ostring> roll_locations{ "top","lo","t","er","666" }; std::vector<ocilib::ostring> roll_kinds{ "w","b","x","er" ,"666" }; // Is the date pointer displayed in roll_change_times null? Why is this? std::vector<ocilib::Date> roll_change_times(4, ocilib::Date("2022-12-24 12:38:44", "yyyy-MM-dd HH24:mi:ss")); std::vector<float> roll_diameters{ 1203.44f,333.f,555.f,55.67f ,555.0f }; rollchan(roll_ids, roll_change_times, roll_diameters, roll_locations, roll_kinds);
The following are the stored results? Confused 0002-11-30:
The text was updated successfully, but these errors were encountered:
Is it because ocilib::Date has no corresponding copy constructor?
Sorry, something went wrong.
hello? Is anybody here?
Hi,
I will investigate this issue prior the release of v4.7.7
Regards,
Vincent
linked to #351
ocilib::Date has no corresponding copy constructor
It does (using parent class) but this copy constructor, is using handle ref counting assignement not value copy.
Commit 8f05b7e added specific copy assignement for "value" datatypes.
And by the way, in your example code, the date vector was passed by value and not by reference liek others ones.
vrogier
No branches or pull requests
Write the code as follows, please focus on the roll_change_times variable.
The following are the stored results? Confused 0002-11-30:
The text was updated successfully, but these errors were encountered: