Basically I am a SQL based programmer and I had to struggle for getting the number or records fetched in a query in Progress 4GL. I heard there is a function COUNT in 4GL also likely to SQL for counting records, but I found it compromising execution time than the normal FOR EACH loop. Lets have a look on either approaches to count records in 4GL with consideration of execution time.
Scenario:
Lets say, I have a table named 'cm_mstr' with 180,000 customer records. We will examine each of the methods for counting those 180,000 along with performance.
Using FOR EACH:
Using COUNT:
Scenario:
Lets say, I have a table named 'cm_mstr' with 180,000 customer records. We will examine each of the methods for counting those 180,000 along with performance.
Using FOR EACH:
Using COUNT: