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? I tried:

LongRowset oids = (sql.prepare << string("select distinct oid from
Gemius_Node where node_ID_FK=5") , into(ind));

But this results in some compilation errors:

error: incomplete type
‘soci::details::exchange_traits<soci::indicator>’ used in nested name
specifier|

IMHO fetching null value shuld result in empty rowset:

rowset<unsigned long> accounts = sql.prepare << string("select
distinct owner_ID_FK as konto from Simple_Node where ID=5");
if(accounts.empty())
{
  //no results  - now I can react
}

but rowset template don't have empty() method. It don't have even
size() method and I don't understand why.

Can you explain how to check for empty result in rowset assignment?

-- 
Regards,

Michał Nowotka

------------------------------------------------------------------------------
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

Reply via email to