Previous Page | Next Page

Filtering a GetMetadataObjects Request

Sample Search Strings For Common Filters


Single Attribute Search on the Metadata Type in the <TYPE> Element

Both of the following <XMLSELECT> elements select all objects that have a Name= attribute value of John Doe:

  <XMLSelect search="*[@Name='John Doe']"/>
 <XMLSelect search="Person[@Name='John Doe']"/>


Single Attribute Search on a Subtype of the <TYPE> Element

The following <XMLSELECT> element selects PhysicalTable objects that have a DBMSType= attribute value of Oracle:

<Type>RelationalTable</Type>
...
<XMLSELECT search="PhysicalTable[@DBMSType='Oracle']"/> 


Selecting Objects Whose Attributes Begin With a Value

The following <XMLSELECT> element selects Person objects that have a Name= value that begins with John:

<XMLSELECT search="Person[@Name =:'John']"/>


Selecting Objects Whose Attributes Have a Missing Value or Blank String

The following <XMLSELECT> element selects WorkTable objects that have a missing numeric value in the NumRows= attribute:

<XMLSELECT search="WorkTable[@NumRows='.']"/>

The following <XMLSELECT> element selects WorkTable objects that have a blank string in the MemberType= attribute:

<XMLSelect search="WorkTable[@MemberType='']"/>


Specifying Concatenated Attributes

The following <XMLSELECT> element selects objects that have either the Name= attribute value of John Doe or Jane Doe:

<XMLSELECT search="*[@Name='John Doe' OR @Name='Jane Doe']"/> 

The logical operator can be specified in uppercase or lowercase letters.


Searching By Association Name

The following <XMLSELECT> element selects objects that have any objects associated with them through the ResponsibleParties association:

<XMLSELECT search="*[ResponsibleParties/*]"/>


Searching by Association Name and Attribute Criteria

The following <XMLSELECT> element selects any objects that have a Role= attribute value of OWNER associated with them through the ResponsibleParties association:

<XMLSELECT search="*[ResponsibleParties/*[@Role='OWNER']]"/>


Specifying Multiple Association Levels in an Association Path

The following <XMLSELECT> element selects objects that have a Role= attribute value of OWNER associated with them through the ResponsibleParties association. The ResponsibleParties association has a Persons association to a Person object that has a Name= attribute value of John Doe.

<XMLSELECT search="*[ResponsibleParties/*[@Role='OWNER']
/Persons/Person[@Name='John Doe']]"/>

The following <XMLSELECT> element selects objects owned by any type of object with a Name= attribute value of John Doe:

<XMLSELECT search="*[ResponsibleParties/*[@Role='OWNER']/
Persons/*[@Name='John Doe']]"/>

This request is identical to the preceding request, except that an asterisk is substituted for the Person object to specify any object in the second path level. The Persons association supports associations to Person and IdentityGroup objects. Specifying an asterisk in this position causes the SAS Metadata Server to evaluate IdentityGroup objects and Person objects in its search.


Specifying Concatenated Association Paths

The following <XMLSELECT> element selects objects that have objects associated to them through the ResponsibleParties and Reports associations that meet the criteria specified for those association names.

<XMLSelect search="*[ResponsibleParties/*[@Role='Owner']/
Persons/*[@Name='Joe Accountant']]
[Reports/Report[@Name='Sales']/
Groups/Group[@Name='Accountant']]"/>

Each association path is enclosed within a pair of left and right square bracket delimiters. An object is returned when all path levels of each association path are successfully searched using the object as the starting point for each search.

This request returns objects that are owned by a Person or IdentityGroup named Joe Accountant and also have a Reports association to a Report with a name of Sales that belongs to a Group named Accountant.

Previous Page | Next Page | Top of Page