Is there a built-in function or variable that provides the number of rows returned from an MvOPENVIEW query? Or do I just have to loop the result, or run a separate COUNT(*) query?
Announcement
Collapse
No announcement yet.
Get Number of Rows Returned from MvOPENVIEW
Collapse
X
-
I'm not aware of any SQL type return, and if you look at the LSK all API functions that return a "records found" listing include a loop counter.Bruce Golub
Phosphor Media - "Your Success is our Business"
Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
phosphormedia.com
-
Thanks, Bruce, that helps. I also found a reference to a few related variables on mivascript.com:
- db_alias.d.totrec: total number of records in the database
- db_alias.d.recno : current physical record number in the database
- db_alias.d.eof: Read as true if the end of the database has been reached.
- db_alias.d.deleted: Reads as true if the records is marked for deletion.
However, these were part of the MvOPEN documentation, and only db_alias.d.recno and db_alias.d.eof have a value when I use them with an MvOPENVIEW dataset. I haven't tested an MvOPEN call to confirm whether they work with that or if they were deprecated somewhere along the way.
It would certainly be simpler and require less code if db_alias.d.totrec worked, but I'll just do a loop for now since that seems to be the accepted way to handle it.
Comment
-
I don't recall if .totrec was the returned records or just total records. I believe its a hold over from dbf databases. You could write the query to return the total rows open (select as count) but, I think it would be much clearer/easier just to do a loop count.Bruce Golub
Phosphor Media - "Your Success is our Business"
Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
phosphormedia.com
Comment
Comment