>From just looking at your code, id will be put in p_id, map_id into px, x
into py, y into ptype etc., following the way the fields in SELECT nad the
into() expressions are ordered, which is probably not what you want?
Thanks,
Aleksander
On Thu, Mar 7, 2013 at 3:28 AM, Nicolas Deroche <[email protected]> wrote:
> I did soci::use(map_id), but i'm not saving this field, just setting a
> clause on it.
> But I never checked if this could be the error, I'll do that when i'm back
> from work.
>
> I just hope it's something else, it'd really be a shame if it was that..
>
> thanks
>
>
> 2013/3/7 Wacha Gábor <[email protected]>
>
>> Hello,
>>
>> I am new in using soci, but haven't you forgotten soic::into(map_id)?
>>
>> You've selected map_id, but there is nothing to put that into.
>>
>> Gabor
>>
>>
>> 2013-03-07 09:14 keltezéssel, Nicolas Deroche írta:
>>
>> Hello !
>> I'm fetching a list using statements, here's the code:
>>
>> * game::portal_id_t p_id, p_t2, ptype = 0;**
>> ** game::map_id_t p_t, px, py, pfx, pfy;**
>> **
>> ** soci::statement subst2 =**
>> ** (sql.prepare << "SELECT "**
>> ** << "`id`, `map_id`,`x`, `y`, `type`, `target`,
>> `target2`, `forcex`, `forcey` "**
>> ** << "FROM `pack_maps_portals` "**
>> ** << "WHERE `map_id`=:map_id "**
>> ** << "ORDER BY `id` ASC",**
>> ** soci::into(p_id),**
>> ** soci::into(px),**
>> ** soci::into(py),**
>> ** soci::into(ptype),**
>> ** soci::into(p_t),**
>> ** soci::into(p_t2),**
>> ** soci::into(pfx),**
>> ** soci::into(pfy),**
>> ** soci::use(map_id));**
>> **
>> ** subst2.execute();**
>> ** while(subst2.fetch())**
>> ** {**
>> ** std::cout << "PORTAL: mapid " << map_id << " portal_id:"
>> << p_id << ", type: " << ptype << "- x:" << px << "- y;" << py**
>> ** << "; map=" << p_t << " portal=" << p_t2 << std::endl;**
>> ** map_ps.insert({p_id,**
>> ** new
>> game::Portal(px,py,p_id,0,ptype,p_t,p_t2,pfx,pfy)});**
>> ** }*
>>
>> The thing is that, the value of "ptype" is into "px" and "px" into
>> "ptype".
>> Same for p_t and p_t2, they are swapped aswell.
>>
>> And it certainly disturbs me to swap the soci::into(...) lines because it
>> does not match the correct field order in the SQL statement ...
>>
>> How can I fix that?
>> Thanks, nico
>>
>>
>> ------------------------------------------------------------------------------
>> Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester
>> Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the
>> endpoint security space. For insight on selecting the right partner to
>> tackle endpoint security challenges, access the full report.
>> http://p.sf.net/sfu/symantec-dev2dev
>>
>>
>>
>> _______________________________________________
>> soci-users mailing
>> [email protected]https://lists.sourceforge.net/lists/listinfo/soci-users
>>
>>
>>
>> --
>> Üdvözlettel,
>> Wacha Gábor
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester
>> Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the
>> endpoint security space. For insight on selecting the right partner to
>> tackle endpoint security challenges, access the full report.
>> http://p.sf.net/sfu/symantec-dev2dev
>> _______________________________________________
>> soci-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/soci-users
>>
>>
>
>
> ------------------------------------------------------------------------------
> Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester
> Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the
> endpoint security space. For insight on selecting the right partner to
> tackle endpoint security challenges, access the full report.
> http://p.sf.net/sfu/symantec-dev2dev
> _______________________________________________
> soci-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/soci-users
>
>
------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the
endpoint security space. For insight on selecting the right partner to
tackle endpoint security challenges, access the full report.
http://p.sf.net/sfu/symantec-dev2dev
_______________________________________________
soci-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/soci-users