Alternative for RecordCount ?
Posted: 13.01.2006, 18:03
Hello!!
Searching the forum and trying myself, I think the RecordCount is an expensive property and may be used with caution to avoid the component to pass through all the matched data only to count the rows...
It's become more evident when we use big databases, like one I made to test, with 350000 rows..
So, in my program there's a function that checks if certain data is already in the table. I use as parameters the name of the table, the column and data do compare. Internal, there's a ZReadOnlyQuery executing a select with the function data, and finally it compares the RecordCount of the query with zero, becouse if it's one or more, the data is duplicated.
For that propouses, could I use the RecNo property? If the SQL results no data, the RecNo returns zero, no rows, no RecNo. But if the SQL returns data, the RecNo becomes one, and symbols the duplicate record.
Could the RecNo used for that? It's less expensive than RecordCount?
Sorry for the bad writing
Thanks in advance!
Searching the forum and trying myself, I think the RecordCount is an expensive property and may be used with caution to avoid the component to pass through all the matched data only to count the rows...
It's become more evident when we use big databases, like one I made to test, with 350000 rows..
So, in my program there's a function that checks if certain data is already in the table. I use as parameters the name of the table, the column and data do compare. Internal, there's a ZReadOnlyQuery executing a select with the function data, and finally it compares the RecordCount of the query with zero, becouse if it's one or more, the data is duplicated.
For that propouses, could I use the RecNo property? If the SQL results no data, the RecNo returns zero, no rows, no RecNo. But if the SQL returns data, the RecNo becomes one, and symbols the duplicate record.
Could the RecNo used for that? It's less expensive than RecordCount?
Sorry for the bad writing
Thanks in advance!