realbasic-nug
[Top] [All Lists]

RE: MySQl recordcount

To: "'REALbasic NUG'" <realbasic-nug at lists dot realsoftware dot com>
Subject: RE: MySQl recordcount
From: "Stephen Koger" <steve dot koger at m-a-c-s dot com>
Date: Thu, 31 Mar 2005 11:52:05 -0600
Delivered-to: realbasic-nug at lists dot realsoftware dot com
Thread-index: AcU2GNweJ4k+/tx8SpqG/flkXpR1bwAAU+EQ
You can move back to the top of the Recordset by just doing a
mydb.MoveFirst command

Steve


-----Original Message-----
From: realbasic-nug-bounces at lists dot realsoftware dot com
[mailto:realbasic-nug-bounces at lists dot realsoftware dot com] On Behalf Of 
Michael
Bierly
Sent: Thursday, March 31, 2005 11:41 AM
To: REALbasic NUG
Subject: Re: MySQl recordcount

You've basically got two choices:

1) Read through the RecordSet and count the number of records the
query would return and then re-execute the query a second time to
create the RecordSet for actual processing. To the best of my
knowledge the RecordSet returned from MySQL is forward-only; hence the
need to run the query twice.

or

2) Execute the query "Select count(*) from table..." the first time to
let MySQL return the count of the records it would process. and then
Execute a second query to return the records themselves.

The problem with either of these approaches is that if the table has a
lot of activity : adds and/or deletes, then by running two seperate
queries there is a potential that the number of records in Query1
doesn't match the number of records in Query2.


On Thu, 31 Mar 2005 12:07:00 -0500, Steve Suranie <ssuranie at merion dot com>
wrote:
> Is there an easy way or even a hard way to get the recordcount of  a MySQL
> db in rb?
> 
> _______________________________________________
> Unsubscribe or switch delivery mode:
> <http://www.realsoftware.com/support/listmanager/>
> 
> Search the archives of this list here:
> <http://support.realsoftware.com/listarchives/lists.html>
> 


-- 

Regards,
Mike Bierly
mbierly at gmail dot com
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>