Author: Suja.Sai
Subject: Dynamic array request/response containers
Posted: Tue Jan 24, 2017 11:37 am (GMT 5.5)
Hi,
We have the below requirement.
The input request container has the count of number of records passed in the input request array container. For each input record fetched, we have to query the table and if the record is found in the table, then we have to put it in the response array container.
The response array container is declared as an unbounded dynamic array.
We do not have the count of the output records until we process the final input record. For each input record, there may/maynot be an output record.
Please suggest if the below approach is ok to populate the dynamic response array container?
Do the below processing for each record fetched from the table...
1) Calculate the dynamic response array length for the fetched record
2) GetMain
3) Populate the response array container
4) Put the response array container
5) FreeMain
I doubt if it is a good practice to use getmain and freemain frequently in a loop. Please let me know if there are other better ways to achieve this.
Please help.
Thanks,
Suja
Subject: Dynamic array request/response containers
Posted: Tue Jan 24, 2017 11:37 am (GMT 5.5)
Hi,
We have the below requirement.
The input request container has the count of number of records passed in the input request array container. For each input record fetched, we have to query the table and if the record is found in the table, then we have to put it in the response array container.
The response array container is declared as an unbounded dynamic array.
We do not have the count of the output records until we process the final input record. For each input record, there may/maynot be an output record.
Please suggest if the below approach is ok to populate the dynamic response array container?
Do the below processing for each record fetched from the table...
1) Calculate the dynamic response array length for the fetched record
2) GetMain
3) Populate the response array container
4) Put the response array container
5) FreeMain
I doubt if it is a good practice to use getmain and freemain frequently in a loop. Please let me know if there are other better ways to achieve this.
Please help.
Thanks,
Suja