dbTalk Databases Forums  

Current Date and time

mailing.database.mysql-plusplus mailing.database.mysql-plusplus


Discuss Current Date and time in the mailing.database.mysql-plusplus forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Craig Snyder
 
Posts: n/a

Default Current Date and time - 08-05-2005 , 03:10 PM






------=_NextPart_000_0010_01C599BE.17702A70
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit

I need to insert the current date and time into several tables. Can I use
the NOW() function and if so how do I call it? If not what is the best
solution?


------=_NextPart_000_0010_01C599BE.17702A70--



Reply With Quote
  #2  
Old   
Warren Young
 
Posts: n/a

Default Re: Current Date and time - 08-08-2005 , 05:20 AM






Craig Snyder wrote:
Quote:
Can I use the NOW() function and if so how do I call it?
Treat it as any other query, using the Query class.

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #3  
Old   
Warren Young
 
Posts: n/a

Default Re: Current Date and time - 08-09-2005 , 11:18 PM



Craig Snyder wrote:
Quote:
Is there a certain include file I need to add as when I compile the
application with the function in the query it does not understand that
function?
It's not a C++ function. It's SQL text:

Query q = conn.query();
q << "INSERT INTO whatever VALUES(NOW())";

This really has nothing to do with MySQL++, unless you want to add some
wrapper for this mechanism as a patch.

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.