ph_getsqlrows PowerHome formula function
Description
Returns the current number of rows in the specified data retrieval area.
Syntax
ph_getsqlrows ( ai_id )
ph_getsqlrows ( ai_id, ai_type )
Argument Description
ai_id Integer. The data retrieval area you wish to get the number of rows (1 – 20).
ai_type Integer (Optional). The type of row counts you would like returned for the Data Retrieval area. If this parameter is omitted, 0 will be used. See Usage below for details 
Return value
Long. Returns the number of rows currently within the data retrieval area for the specified ai_type value. Returns -1 if parameter ai_id is out of range. Returns -2 if the specified Data Retrieval area is not valid. Returns -3 if parameter ai_type is out of range 
Usage
Use this function to retrieve the number of rows associated with a specific area within a Data Retrieval Area. 

The valid values for the ai_type parameter are:

  • 0 - Return the count of rows in the primary section of the Data Retrieval area. This is equivalent to the system variables SQLROWS1 thru SQLROWS20
  • 1 - Return the count of rows that have been filtered in the Data Retrieval area
  • 2 - Return the count of rows that have been modified in the Data Retrieval area
  • 3 - Return the count of rows that have been deleted in the Data Retrieval area
  • Any other value will return -3
  • Examples
    The following examples demonstrate typical syntax/usage for this function.
    • ph_getsqlrows(5) - Returns the number of rows in the primary data section of Data Retrieval area 5. This is the same value as system var SQLROWS5