Hi Art,

Staffan knows ooSQLite better than I do, at least as far as what SQLite can
and can not do.  There is no way to know how many rows will be returned
from a SELECT statement without 'stepping' through all the rows and
counting them.

In case Staffan's solution was a little obscure to you, when he says: you
can do a SELECT COUNT(*) ...

I think what he means, and he can correct me if I'm wrong, is to add the
count to your SELECT statement.  Not use 'SELECT COUNT(*);' exactly.  So if
you were going to do for instance:

"SELECT * FROM foods where name like 'J%' ORDER BY name COLLATE REVERSE;"

Then you would add the COUNT(*) to the select and execute that SQL.  This
would give you the count of rows that would be returned.  Then you would
turn around and execute the SELECT statement without the count to get your
rows.  You just need to realize that you will be executing the SELECT
statement twice.

In my mind this doesn't give you much.  Why not just execute the SELECT
once and see how many items you end up with.  But, it may be a good
solution for what you want.

--
Mark Miesfeld




On Tue, Oct 29, 2013 at 6:11 AM, Art Heimsoth <[email protected]>wrote:

> Is there a way to find out the number of rows returned from
> a select statement before checking the stmt~STEP value?  I
> use a common routing to perform all of the Selects where I
> have the stmt~.ooSQLiteStmt~new(database, sql_stmt) and
> check the ~initCode on return.  I would also like to be able
> to check to see how many rows will be returned from the
> subsequent ~STEP statements.
>
> --
>  Art Heimsoth - [email protected]
>
>
> ------------------------------------------------------------------------------
> Android is increasing in popularity, but the open development platform that
> developers love is also attractive to malware creators. Download this white
> paper to learn more about secure code signing practices that can help keep
> Android apps secure.
> http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
> _______________________________________________
> Oorexx-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/oorexx-users
>
>
------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
Oorexx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oorexx-users

Reply via email to