Loading ...
Loading ...
Loading ...
T24 Application Development
Implementing the Queries
The implementation of each query is in the DAS subroutine itself. This must be created from the
template DAS.TEMPLATE, and each query is an additional CASE statement based on MY.CMD,
which holds the name of the query.
In addition to the queries defined specifically for the application, the generic query
DAS$ALL.IDS is
defined to return all the keys on the table. It is only necessary to include this query in the DAS if this
list can be cached, i.e. the contents of the table are static at run time.
CASE MY.CMD = DAS$ALL.IDS ; * Standard to return all keys
ADD.TO.CACHE = 1
Simple queries define the fields, operands and the data to query. The data may be literals:
CASE MY.CMD = dasExamplesInterestSchedules;* All interest schedules
MY.FIELDS = 'SCHEDULE.TYPE'
MY.OPERANDS = 'EQ'
MY.DATA = 'INTEREST'
Common variables:
CASE MY.CMD = dasExamplesTodaysSchedules;* All schedules due today
MY.FIELDS = 'SCHEDULE.DATE'
MY.OPERANDS = 'EQ'
MY.DATA = TODAY
Or use variable criteria that is supplied when the DAS is invoked:
CASE MY.CMD = dasExamplesDealsOfAType ;* Contracts of a certain DEAL.TYPE
MY.FIELDS = 'DEAL.TYPE'
MY.OPERANDS = 'EQ'
MY.DATA = THE.ARGS
More complex queries are defined by adding fields to the arrays, and specifying the MY.JOINS array:
CASE MY.CMD = dasExamplesCustomerCurrency; * For a customer with given CCY
MY.FIELDS = 'CUSTOMER'
MY.OPERANDS = 'EQ'
MY.DATA = THE.ARGS<1>
MY.JOINS = 'AND'
MY.FIELDS<2> = 'CURRENCY'
MY.OPERANDS<2> = 'EQ'
MY.DATA<2> = THE.ARGS<2>
Caching Query Results
The DAS infrastructure allows the caching of results by setting:
ADD.TO.CACHE = 1
Once the query results have been returned, they are added to the cache mechanism and further
invocation of the named select will always use the cached results. The cache must ONLY be used
where the result of the query is static at run time, e.g. CATEGORY or COMPANY. Caching must NOT
be used where variable data is used in the selection.
TEMENOS T24 User Guide Page 23 of 34
Loading ...
Loading ...
Loading ...