 GetRowCount - Maple Help

Result

 GetRowCount
 get the number of rows in the table Calling Sequence result:-GetRowCount( ) Parameters

 result - Result module Description

 • GetRowCount returns the number of rows in result.
 • GetRowCount finds the number of rows by looking at the row index of the last row in the table.  When working with very large tables and a fetchsize in place, GetRowCount may be a relatively expensive command to execute. Examples

Create a Result.

 > $\mathrm{driver}≔\mathrm{Database}\left[\mathrm{LoadDriver}\right]\left(\right):$
 > $\mathrm{conn}≔\mathrm{driver}:-\mathrm{OpenConnection}\left(\mathrm{url},\mathrm{name},\mathrm{pass}\right):$$\mathrm{res}≔c:-\mathrm{ExecuteQuery}\left("SELECT id FROM animals WHERE id = 1"\right):$$\mathrm{res}:-\mathrm{GetRowCount}\left(\right)$
 ${1}$ (1)
 > $\mathrm{res}≔c:-\mathrm{ExecuteQuery}\left("SELECT id FROM animals WHERE id BETWEEN 1 AND 2"\right):$$\mathrm{res}:-\mathrm{GetRowCount}\left(\right)$
 ${2}$ (2)
 > $\mathrm{res}≔c:-\mathrm{ExecuteQuery}\left("SELECT id FROM animals WHERE id BETWEEN 1 AND 4"\right):$$\mathrm{res}:-\mathrm{GetRowCount}\left(\right)$
 ${4}$ (3)
 > $\mathrm{res}≔c:-\mathrm{ExecuteQuery}\left("SELECT id FROM animals WHERE id BETWEEN 1 AND 8"\right):$$\mathrm{res}:-\mathrm{GetRowCount}\left(\right)$
 ${8}$ (4)
 > $\mathrm{res}≔c:-\mathrm{ExecuteQuery}\left("SELECT id FROM animals WHERE id = 11"\right):$$\mathrm{res}:-\mathrm{GetRowCount}\left(\right)$
 ${0}$ (5)