Excluding temp-tables on fill in data-access layer

Posted by Johan Vergeer on 22-Mar-2017 03:04

Hi everyone, 

I am building my first Data-access class using a ProDataSet

What I was attempting is something like this:

First get all the main customer information

METHOD PUBLIC VOID GetCustomerData( INPUT pFilter AS CHARACTER, OUTPUT DATASET dsCustomer):
    DATASET dsCustomer:EMPTY-DATASET.

    THIS-OBJECT:CustomerDataSource:attach(BUFFER ttCustomer:HANDLE, pFilter).
    THIS-OBJECT:CustomerAddressDataSource:attach(BUFFER ttCustomerAddress:HANDLE).
    THIS-OBJECT:CountryDataSource:attach(BUFFER ttCountry:HANDLE).
    THIS-OBJECT:CountryTranslationDataSource:attach(BUFFER ttCountryTranslation:HANDLE).

    DATASET dsCustomer:FILL().

    THIS-OBJECT:CustomerDataSource:detach(BUFFER ttCustomer:HANDLE).
    THIS-OBJECT:CustomerAddressDataSource:detach(BUFFER ttCustomerAddress:HANDLE).
    THIS-OBJECT:CountryDataSource:detach(BUFFER ttCountry:HANDLE ).
    THIS-OBJECT:CountryTranslationDataSource:detach(BUFFER ttCountryTranslation:handle).

RETURN.
END METHOD.

After that I would like to add some more data to the dataset if it is required:

METHOD PUBLIC VOID GetMultipleData( INPUT-OUTPUT DATASET dsCustomer): 
    // Don't empty the dataset, but add invoice data to the existing dataset. Of course we have to make sure there are customers in the dataset before calling this method

    THIS-OBJECT:MultipleDataSource:attach(BUFFER ttMultiple:HANDLE).

    DATASET dsCustomer:FILL().

    THIS-OBJECT:MultipleDataSource:detach(BUFFER ttMultiple:HANDLE).

RETURN.
END METHOD.

When I try to run this I get an error on calling of the GetCustomerData() method, MultipleDataSource has to be attached before the dataset can be filled. 

I get the error message, and the simple solution would just be to fill the entire dataset with all the data every time, but that would also imply a lot of redundant data in the dataset. 

In this case there is just some basic information, but you can imagine that a customer does not only have this information, but also invoices (with invoice lines), orders (with order lines), etc... 

Is it possible to just get the information and fill the temp-tables for the required data?

Else: is performance of OpenEdge ProDataSets so awesome that I do not have to worry about the extra data that is filled every time? 

All Replies

Posted by John Cleaver on 20-Mar-2018 15:44

I know this question is quite old, but you probably want to look into the fill-mode attribute:

documentation.progress.com/.../index.html

If you set the fill mode for the MultipleDataSource to No-Fill when you don't want that table filled, you should get the behavior you want.

This thread is closed