Michał Nowotka wrote:
> Hello,
>
> I have some serious problem with soci::rowset template.
>
> Consider following code:
>
> rowset<unsigned long> accounts = sql.prepare << string("select
> distinct owner_ID_FK as konto from Simple_Node where ID=5");
>
> What happens when result of above query is null? I get an exception:
>
> Error: Null value fetched and no indicator defined.
>
> How can I avoid throwing this exception?
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.
Try to handle null values properly as explained in the manual:
http://soci.sourceforge.net/doc/exchange.html#data_states
> Can you explain how to check for empty result in rowset assignment?
For example, this way:
bool iseof = (accounts.begin() == accounts.end());
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