Template:AskPlus E.8.4.5
Revision as of 00:12, 13 April 2018 by >Johno (Created page with "'''Enhancements:''' :'''Outer Join:''' :* In version E.8.4.4 (and the E.8.4.3 Beta) the OUTER keyword was introduced to support outer joins in the FIND command. This was a ...")
Enhancements:
- Outer Join:
- In version E.8.4.4 (and the E.8.4.3 Beta) the OUTER keyword was introduced to support outer joins in the FIND command. This was a global keyword that effected all sets used in the FIND.
- In version E.8.4.5 the syntax of the OUTSEL statement was enhanced so that the OUTER join logic could be applied to individual sets (rather than all sets).
- To specify an outer join in the OUTSEL, prefix the topic name with a plus sign as shown below.
Selection Syntax Using OUTER Keyword:
FIND PRIMARY=MEMBER-FILE;OUTSEL=(@) OUTER (LOAN-FILE.BALANCE > 100000 AND LOAN-FILE.REST-FLAG-11 <> 80 AND LOAN-FILE.SUFFIX = VEHICLE-INFO.SUFFIX)
- Using the above syntax, because the OUTER applies to all secondary sets, all member-file records will be selected, even members that do not have qualifying loans. Of course this problem could be fixed by changing the primary to LOAN-FILE, but it can also be resolved using the following syntax.
Selection Syntax Using OUTSEL OUTER syntax:
FIND PRIMARY=MEMBER-FILE OUTSEL=(MEMBER-FILE, LOAN-FILE, +VEHICLE-INFO) (LOAN-FILE.BALANCE > 100000 AND LOAN-FILE.REST-FLAG-11 <> 80 AND LOAN-FILE.SUFFIX = VEHICLE-INFO.SUFFIX)
- The plus sign that prefixes VEHICLE-INFO in the OUTSEL indicates that the outer logic should only apply to the join with VEHICLE-INFO. Therefore this selection will select members with qualifying loans, and it will select any matching VEHICLE-INFO records, however, no loans will be dropped when no matching VEHICLE-INFO record is found.