Overview
Features
Download
Documentation
Community
Add-Ons & Services

Poco::Data documentation

Please post support and help requests here.

Poco::Data documentation

Postby dbarzo » 03 Jun 2014, 12:10

Hi,

I don't know if the docs have to be updated but...looking into it I read:

It is also possible to combine into and use expressions:

Code: Select all
std::string aName;
std::string match("Peter")
ses << "SELECT NAME FROM FORENAME WHERE NAME=:name", into(aName), use(match), now;
poco_assert (aName == match);



But if I run a query like this in an MySQL project, I get a syntax error.

Looking to this post I see that the placeholder for the use clause must be an '?' not a ':var'.
So...is the documentation wrong?

Regards,
Daniele.
dbarzo
 
Posts: 38
Joined: 14 Jan 2013, 17:15
Location: Italy

Re: Poco::Data documentation

Postby fbraem » 03 Jun 2014, 16:02

MySQL does not support :name syntax for placeholders
Zumuta!, that's the way to do IT!
fbraem
 
Posts: 105
Joined: 11 Aug 2008, 22:47
Location: Belgium

Re: Poco::Data documentation

Postby alex » 04 Jun 2014, 04:35

dbarzo wrote:So...is the documentation wrong?


Some back-ends support :name but, generally speaking, ? is always a safer bet. The :name syntax is a "leftover" from long time ago when the first data backend (SQLite) was introduced. We never quite purged its traces out of the codebase.
alex
 
Posts: 1132
Joined: 11 Jul 2006, 16:27
Location: United_States

Re: Poco::Data documentation

Postby dbarzo » 04 Jun 2014, 08:52

alex wrote:Some back-ends support :name but, generally speaking, ? is always a safer bet. The :name syntax is a "leftover" from long time ago when the first data backend (SQLite) was introduced. We never quite purged its traces out of the codebase.


Thanks a lot for the clarification Alex.

Regards.
dbarzo
 
Posts: 38
Joined: 14 Jan 2013, 17:15
Location: Italy


Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron