Re: [Cppcms-users] cppdb::statement.affected() usage?
Brought to you by:
artyom-beilis
From: Artyom <art...@ya...> - 2011-02-15 16:30:57
|
> Subject: Re: [Cppcms-users] cppdb::statement.affected() usage? > > Thank you a lot for the clarification! > > > Yes, number of affected rows is number of rows affected by > > statements like DELETE or UPDATE, the behavior of affected() > > when using queries (like SELECT) is undefined and may cause > > exceptions. > > It will save users much time if this behavior is documented. > It is documented the term "affected" is something known in general for SQL handling. > Also, it will be handy if the number of selected rows (returned by libpq's > PQntuples()) is implemented in either cppdb::statement or cppdb::result. > Without this feature, it seems that iterating cppdb::result (by calling > next()) is the only available way to know the number of selected rows. > Wrong? > The problem is this is not always known as you get the data by iterating over it so in some backends like sqlite3 you can know this only after fully iterating the entire data set and somethimes it is not so good idea. So this option is not supported as in some cases the data is not fetched in whole. Artyom |