Add-Ons & Services

bugs in document

Please post support and help requests here.
Posts: 1
Joined: 08 Oct 2013, 05:15

bugs in document

Postby hyphen » 08 Oct 2013, 06:24

in the topic of Complex Data Type Mapping:http://pocoproject.org/docs/00200-DataUserManual.html#9

Code: Select all

 static void prepare(std::size_t pos, const Person& obj, AbstractPreparation* pPrepare)
        poco_assert_dbg (pBinder != 0);
        // the table is defined as Person (FirstName VARCHAR(30), lastName VARCHAR, SocialSecNr INTEGER(3))
        // Note that we advance pos by the number of columns the datatype uses! For string/int this is one.
        TypeHandler<std::string>::prepare(pos++, obj.getFirstName(), pPrepare);
        TypeHandler<std::string>::prepare(pos++, obj.getLastName(), pPrepare);
        TypeHandler<Poco::UInt64>::prepare(pos++, obj.getSocialSecNr(), pPrepare);

the first line should be

Code: Select all

poco_assert_dbg (pPrepare != 0);

And at here:http://pocoproject.org/docs/00200-DataUserManual.html#2
I can't insert a value in this way:

Code: Select all

std::string aName("Peter");ses << "INSERT INTO FORENAME VALUES(:name)", use(aName), now;

And this is obviously wrong :

Code: Select all

std::string aName("Peter");
ses << "INSERT INTO FORENAME VALUES(" << aName << ")", now;

And this is ok:

Code: Select all

std::string aName("Peter");
ses << "INSERT INTO FORENAME VALUES('" << aName << "')", now;
(I hope you could find the difference :) )

Return to “Support”

Who is online

Users browsing this forum: No registered users and 1 guest