Michał Nowotka wrote:
>> It says that value of field in rowset is null
>> and no indicator was defined to signal that condition.
>> It is not related to the fact if rowset is empty or not.
>
> Ok, so I have rowset containing some nulls.
Presumably, yes.
> So how can I check this during iteration?
>
> rowset<unsigned long> accounts = sql.prepare << string("select
> distinct owner_ID_FK as konto from Simple_Node where ID=5");
> for (soci::rowset<unsigned long>::const_iterator nodeIterator =
> nodeIDs.begin(); nodeIterator != nodeIDs.end(); ++nodeIterator)
> {
> //now when ++operator is called I can always get exception
> thrown if next element is null...
> }
I will *reiterate* myself, the manual provides comprehensive explanation
illustrated with code example. Read the "Handling nulls and other
conditions" section and notice the "into(name, ind)" part
http://soci.sourceforge.net/doc/exchange.html#data_states
Also, from on the very same page, read the note at the bottom
about Boost.Optional and follow suggested link.
I can't imagine how to make it easier :-)
Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Soci-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/soci-users