dbTalk Databases Forums  

Using MySQL Functions

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


Discuss Using MySQL Functions in the mailing.database.mysql-plusplus forum.



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

Default Using MySQL Functions - 09-28-2005 , 12:59 PM






------=_NextPart_000_0016_01C5C41A.BF276130
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit



I would like to use some of the built-in functions available with MySQL such
as NOW(). How do I call them when using MySQL++?



This is an example of what I am trying to do. Unfortunately it fails, what
am I doing wrong?



User row(0, Name, Address, Phone, NOW() );

Query query = con->query();

query.insert(row);

query.execute();







Craig Snyder

Chief Software Architect

<http://www.inclue.com>

inclue! ...the internet on your terms.




------=_NextPart_000_0016_01C5C41A.BF276130--



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

Default Re: Using MySQL Functions - 09-29-2005 , 05:29 AM






Craig Snyder wrote:
Quote:
I would like to use some of the built-in functions available with MySQL such
as NOW(). How do I call them when using MySQL++?
Currently, you have no choice but to create your own SQL statements.

An item for this exists on the Wishlist already. Patches thoughtfully
considered.

--
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   
Ovidiu Bivolaru
 
Posts: n/a

Default Re: Using MySQL Functions - 09-29-2005 , 06:51 AM



Craig,

I think you should try a different approach:
Query query;
query << "insert into users(name,address,phone,timestamp) values (%0q,
%1q, %2q, now() )";
query.parse();
query.store(Name, Address, Phone);

Regards,
Ovidiu

Craig Snyder wrote:

Quote:

I would like to use some of the built-in functions available with MySQL such
as NOW(). How do I call them when using MySQL++?



This is an example of what I am trying to do. Unfortunately it fails, what
am I doing wrong?



User row(0, Name, Address, Phone, NOW() );

Query query = con->query();

query.insert(row);

query.execute();







Craig Snyder

Chief Software Architect

http://www.inclue.com

inclue! ...the internet on your terms.







--
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.