On Aug 21, 2010, at 4:09 PM, [email protected] wrote:

> Hello,
>
> I understand that when I write something like
>
> std::vector<T> vec;
> sql << "select data from table" into vec;
>
> I wont' be getting much data as I need to size the vector.
>
> How do I determine the size of my vector if I want to be sure I will
> always have all the possible rows. Using a very high number seems to  
> be
> inefficient. Writing a select count(*) comes to mind but it is twice  
> the
> work in terms of typing...

You'll want to use a loop in order to get all possible rows, as  
discussed here:
http://soci.sourceforge.net/doc/statements.html#bulk

Steve

------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
Soci-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/soci-users

Reply via email to