Try OpenEdge Now
skip to main content
Introducing the OpenEdge DataSet : Data-Source object : Defining a static Data-Source : Whether or not to define a query for a Data-Source
Whether or not to define a query for a Data-Source
There are several ways you can use a Data-Source. How you are using it determines whether it is appropriate or necessary to associate it with an actual query or simply with one or more buffer names. In the following cases it is appropriate not to have a query for the Data-Source:
*If the Data-Source is for a child table in a relation, then it might indicate that the default query generated by the AVM on a FILL is sufficient. The AVM retrieves all child records for the parent based on their foreign key relationship, so no query is needed.
*If the Data-Source is for a top-level table (one with no parent) and you want to retrieve all records from the table named in its definition, then no query is needed. For a top-level table, retrieving all records is the default action on a FILL operation. This might be appropriate for something like the State table, if it is made a part of a ProDataSet in its entirety for lookup purposes.
*If you are using the Data-Source for update purposes only, then no query is used or needed. The query is used only on a FILL. In this case the Data-Source is actually used as a "Target" for the updates.
*If you intend to attach a query to the Data-Source dynamically at run time, then you do not need to associate it with a query in its definition. As with other ABL objects, the ProDataSet enables you to combine static object definitions and dynamic actions on those objects very flexibly.