Passing a temp-table by value
- Last Updated: March 30, 2020
- 1 minute read
- OpenEdge
- Version 12.2
- Documentation
Passing a temp-table by value
When you pass a temp-table as a parameter from one routine
to another, whether those routines are in the same OpenEdge session
or not, the AVM normally copies the temp-table to make its data
available to the called routine. Copying the table so that both
the calling and the called routines have their own distinct copies
is referred to as passing the table by value. This
can be very expensive if the temp-table contains a large number
of records. If you are making a local routine call, you can use BY-REFERENCE or BIND to
avoid copying the table and thereby gain a significant performance
advantage.
When you pass a temp-table parameter in a remote call, the data is always copied from one routine to the other. That is, if the calling routine and the called routine are in different OpenEdge sessions, the temp-table parameter is always passed by value.