Write ABL client code to retrieve a dataset from the server
- Last Updated: September 14, 2021
- 2 minute read
- OpenEdge
- Version 12.2
- Documentation
The server-side code runs in a Progress Application Server (PAS) for OpenEdge instance, so the client code needs to connect to this application server instance prior to accessing the server-side procedures.
Progress OpenEdge supports all types of clients, but in this set of topics an ABL client is used. The ABL client can be developed using a user interface (UI), such as the ABL GUI or GUI for .NET, or a batch procedure file that runs in the background.
Call server-side code to retrieve a dataset
Recall that the server-side procedure that returns the dataset passes it by
value. In the client, you call the procedure in the server providing an OUTPUT parameter with the DATASET specification.
The following is the simplified syntax for calling an internal procedure that runs in the server that returns a named dataset by value. In this syntax procedure-name is an internal procedure within a persistent procedure on the server.
|
The following is the simplified syntax to run an external procedure. In this
syntax procedure-name is an external procedure
ON SERVER
server-handle.
|
See the RUN statement for more information.
Retrieve a dataset using APPEND
When the client receives the dataset from the server, you can specify whether
you want the dataset to be replaced or appended to. By default, the data in the
dataset is replaced. If you want to append the data in the dataset, you add the
APPEND keyword to the RUN statement as follows:
|
In this example, the procedure GetData is
executed and the dataset dsOrderOrderLine is
returned to the calling procedure. If the dataset has data in it for other Orders,
the data in the dataset that is passed back is appended to the existing data.
When a dataset is returned to the client using the APPEND keyword, an error occurs if duplicate rows are found. For this
reason, you need to write code to pro-actively prevent receiving duplicate rows.
For example, if your client-side dataset contains all order records
for customer 1, the next call that you make to retrieve data from the server (using
APPEND) should filter data so that no customer
1 records are included in the dataset that is returned.