Determining the number of
rows on a table (Count Rows)
A transport map can be configured to return the number of rows on a database table. Using the CountRows operation will return a value which represents the number of rows in the selected database table that meet the select condition. The select condition is specified in a Where clause. If you do not specify a Where clause, you will get a count of the total number of rows in the database table.
When you specify a Count Rows operation, the Count Rows tab provides a read-only view of the
table.
You cannot assign any map variables to any of the rows in the table.
A transport map that uses a Count Rows
operation will not have any output variables. Only the
Input tab becomes available on the
Transport Map window. When you add one or more input
variables to the Input tab, they are used
solely to build a Where clause.
You can build a Where clause without input variables. For example, you can set a column to equal a constant.
Count Rows and the Trigger window
When you assign the transport map as an action in a trigger, you will assign a value for any input map variable that were defined in the transport map for use in the Where clause.
The Output tab will contain the
resultStatus and
resultCount output variables.
The count of rows in the database that meet the select condition will be written to the resultCount variable. The resultStatus variable will contain a code indicating whether or not the transaction completed successfully. A zero indicates success. A non zero value translates to the error code returned either by the node or by the database vendor.