EnsLib.SQL.OutboundAdapter - Getting the row count for Select Query
We would like to know how to get the Row Count of the SELECT query. We query external database via ODBC connection.
//tSQL- is a select query.
Set tStatus = ..Adapter.ExecuteQuery(.tResult,tSQL)
We are trying to get the row count of the retrieved records as below; but It doesn't return any value.
tResult.%ROWCOUNT
$$$TRACE("Result set returned with "_tResult.%ROWCOUNT_" row(s).")
Product version: IRIS 2022.1
Discussion (2)2
Comments
We tried to use tResult.%SQLCODE option also, but we got the same results. It didn't return any result.
%ROWCOUNT doesn't return the total of rows returned by the SELECT, you'll need to execute a previous SELECT COUNT(*) if you want to know the number of rows.
You can read here how %ROWCOUNT is used.