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.

Note: The client code you learn to write in this set of topics is only that part of the client code that retrieves the dataset. In a real client, you would add more code to present a UI or dynamically specify how filters are provided.

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.

RUN procedure-name [IN procedure-handle] ([{parameters},]
    [INPUT|OUTPUT|INPUT-OUTPUT] DATASET dataset-name).

The following is the simplified syntax to run an external procedure. In this syntax procedure-name is an external procedure ON SERVER server-handle.

RUN procedure-name ON [ SERVER ]{server-handle} ([{parameters},]
    [INPUT|OUTPUT|INPUT-OUTPUT] DATASET dataset-name).

See the RUN statement in ABL Reference 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:

RUN GetData IN hProc ("OrderNum = 8005", OUTPUT DATASET dsOrderOrderLine APPEND). 

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.

See also

Pass a ProDataSet with APPEND in Use ProDataSets