Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » Sql Lite schema with DATE type
Re: Sql Lite schema with DATE type [message #51739 is a reply to message #51736] Fri, 10 May 2019 15:05 Go to previous message
NattyRoots is currently offline  NattyRoots
Messages: 2
Registered: April 2019
Junior Member
Hello BioBytes,

Thank you for your answer ! But unfortunately it did not seems to be my problem.

I came up with a solution by storing a timestamp generated in C++ in my column DATE_SESSION, rather than using the SQLDEFAULT() :

.sch :
TABLE_ (SESSION)
	INT_ 	(SESSION_ID) PRIMARY_KEY AUTO_INCREMENT
	STRING_ (BATTLETAG, 200)
	STRING_ (DISCORD_NAME, 200)
	STRING_ (RANK, 4)
	INT_ (DATE_SESSION)
END_TABLE


Code :
std::chrono::milliseconds ms = std::chrono::duration_cast< std::chrono::milliseconds >(
     std::chrono::system_clock::now().time_since_epoch()
);
Sql sqlInsert;
sqlInsert*Insert(SESSION)(BATTLETAG, battletag)(DISCORD_NAME, userName)(RANK, rang)(DATE_SESSION, ms.count());


Thanks for the help anymway,

Natty

[Updated on: Fri, 10 May 2019 15:05]

Report message to a moderator

 
Read Message
Read Message
Read Message
Previous Topic: Field name same as table name
Next Topic: postgresql mingw
Goto Forum:
  


Current Time: Tue May 07 13:58:38 CEST 2024

Total time taken to generate the page: 0.02400 seconds