[JOIN_FIND] (find joined class)
[JOIN_FIND] joins multiple object classes and searches them.
Syntax
-
Joining through use of an association class
[JOIN_FIND] [JOIN] joinassoc;association-class-name; joinfrom;object-class-name,another-object-class-name; jointype;(OUTER|INNER) ([FIND_DATA]) condition-expression [GET_VALUE] assignment-statement ([ORDER_ASC] or [ORDER_DESC]) sort-key ([DUPLICATE]#)
-
Joining by keying on a property
[JOIN_FIND] [JOIN] joinfrom;object-class-name,another-object-class-name; jointype;(OUTER|INNER); joinkey;join-key-class-property-names ([FIND_DATA]) condition-expression [GET_VALUE] assignment-statement ([ORDER_ASC] or [ORDER_DESC]) sort-key ([DUPLICATE]#)
- #
-
Specify the [DUPLICATE] tag to suppress output of the second and subsequent result when the values of all properties of the search results are identical.
Values
-
Join information
Codes the classes to be joined, by using either an association class or key properties.
-
condition-expression
Codes the condition expression. To specify multiple search conditions, join them with an operator. For details about the operators that can be used in condition expressions, see 2.2.4 Operators.
You can omit the [FIND_DATA] tag if you do not use a condition expression.
-
assignment-statement
Codes an assignment statement into which property information from found classes is substituted. When acquiring a property defined in a code table, you can acquire the code table value or the display name. To acquire a display name, add the at mark (@) to the end of class.property.
-
sort-key
To sort the results, specify a sort key, in the format class.property. The [ORDER_ASC] tag sorts results in ascending order, and the [ORDER_DESC] tag sorts results in descending order. If the tag is omitted, the results are sorted in the order of properties specified by the [GET_VALUE] tag.
Status
The following table lists and describes the possible statuses:
Status |
Description |
---|---|
NORMAL |
Normal end. |
NODATA |
No data satisfies the search conditions. |
ERROR |
— |
MULTI |
— |
Example
The following examples search multiple classes.
- Example 1
-
The following example joins asset information, installed software information, and a list of installed software, and outputs a list of installed software information for asset number 1000:
[ASSET_ITEM_LOOP] [JOIN_FIND] [JOIN] joinassoc;InstalledLink; joinfrom;AssetInfo,InstalledInfo; jointype;INNER; [JOIN] joinassoc;InstalledListLink; joinfrom;InstalledInfo,InstalledList; jointype;INNER; [FIND_DATA] (AssetInfo.AssetNo = '1000') [GET_VALUE] INSTALLNAME = InstalledList.InstalledName VERSION = InstalledList.InstalledVersion PERMIT = InstalledList.InstalledPermit@ [SET_VALUE] MSG = INSTALLNAME+'['+VERSION+'] ('+PERMIT+')' $ECHO(MSG) [SET_VALUE] $SETSTATUS('NORMAL') [ASSET_ITEM_LOOP_END]
- Example 2
-
The following example joins asset information and group information, then outputs the group name of asset ID 10000. This example specifies an outer join ([OUTER]) so, if no group ID has been specified, " " is output.
[JOIN_FIND] [JOIN] joinfrom;AssetInfo,GroupInfo; jointype;OUTER; joinkey;AssetInfo.GroupID,GroupInfo.GroupID; [FIND_DATA] (AssetInfo.AssetID = '10000') [GET_VALUE] GROUP_NAME = GroupInfo.FullPathName [SET_VALUE] STATUS = $GETSTATUS() [IF] STATUS = NORMAL [THEN] [SET_VALUE] MSG = 'GROUP = ' + GROUP_NAME $ECHO(MSG) [ELSE] [SET_VALUE] MSG = 'JOIN (' + STATUS + ')' $ECHO(MSG) [IF_END]