Pass a ProDataSet with BY-REFERENCE or BIND
- Last Updated: March 30, 2020
- 1 minute read
- OpenEdge
- Version 12.2
- Documentation
Syntax
Similarly to how temp-tables are passed as parameters, the AVM passes the ProDataSet by value, by default. That is, the AVM copies the ProDataSet definition and all the data in its temp-tables from one procedure to the other. This is true whether the call is to another procedure in the same OpenEdge session, or in a separate OpenEdge session on the other side of an application server connection. The overhead of doing this can be quite high and should be avoided wherever possible.
When you pass a ProDataSet to
a remote session, the AVM has no choice but to copy the data from
one session to the other. However, when you pass a ProDataSet as
a parameter locally, you can optimize the call by including the BY-REFERENCE or BIND keyword on
the parameter in the RUN statement, as shown in
the following syntax examples:
|
|
Passing a ProDataSet to a local routine using
the BY-REFERENCE or BIND keyword allows
the calling routine and the called routine to access the same ProDataSet instance,
instead of copying the ProDataSet, and thereby provides a significant performance
advantage.
When the call is remote, the AVM ignores the BY-REFERENCE and BIND keywords
and passes the ProDataSet by value, as it must in this case.
For more information about using the BY-REFERENCE and BIND keywords, see the
parameter definition syntax and parameter passing syntax reference descriptions in ABL Reference.