2.2.3.8 CT_Result

Target namespace: http://schemas.microsoft.com/office/accessservices/2010/12/application

Referenced by: CT_Results

Specifies one or more columns of data to be included in the CT_Results (section 2.2.3.9) of a CT_Query (section 2.2.3.18).

The specification is for one column of data from a single input source (that is, the All attribute is false and the Name and Source attributes are present), all columns from a single input source (that is, All is true and Source is present), all columns from all input sources (that is, All is true and Source is not present), or a single expression (that is, an Expression child element is present).

Child Elements:

Expression: A CT_ExpressionContents (section 2.2.3.45) element that specifies a single expression to be included in the query results. The expression MUST be evaluated per row in the results. This element MUST NOT be present if the Source or Name attribute is present or if the All attribute is true. When this attribute is present, the Alias attribute MUST also be present.

Attributes:

Alias: An ST_ObjectName (section 2.2.4.1) attribute that specifies an alias for a column in the query results. This attribute MUST NOT be present if the All attribute is set to true. This attribute MUST be present if an Expression child element is present. The value MUST be unique among all Alias attribute values under the CT_Results (section 2.2.3.9) collection.

If the same single column of data is specified by more than one Result element in a CT_Results (section 2.2.3.9) collection, not including Result elements where the All attribute is true, then either all or all but one Result element that specifies the column by including both a Source attribute and a Name attribute MUST have an Alias attribute present.

All: A boolean ([XMLSCHEMA2] section 3.2.2) attribute. If this attribute is true and the Source attribute is present, then the query results contain all columns from the input source indicated by the Source attribute. If this attribute is true and the Source attribute is not present, then the query results contain all columns from all input sources listed in the CT_References (section 2.2.3.7) collection. When this attribute is true, the Expression child element, the Name attribute, and the Alias attribute MUST NOT be present.

Name: An ST_LongString (section 2.2.4.4) attribute that specifies the name of one column from the input source specified by the Source attribute. The data from this column is included in the query results. This attribute MUST NOT be present if the All attribute is set to true or if an Expression child element is present.

Source: An ST_ObjectName (section 2.2.4.1) attribute that specifies the name or alias of one of the input sources to the query. This attribute MUST NOT be present if an Expression child element is present. The input source MUST be listed in the CT_References (section 2.2.3.7) collection of the query. If the CT_Reference (section 2.2.3.6) element specifying the input source contains an Alias value, then this attribute MUST be that value.

The following W3C XML Schema ([XMLSCHEMA1/2] section 2.1) fragment specifies the contents of this complex type.

 <xsd:complexType name="CT_Result">
   <xsd:all>
     <xsd:element name="Expression" type="CT_ExpressionContents" minOccurs="0" wbld:cname="Expression"/>
   </xsd:all>
   <xsd:attribute name="Source" type="ST_ObjectName" wbld:cname="Source" use="optional"/>
   <xsd:attribute name="Name" type="ST_LongString" wbld:cname="Name" use="optional"/>
   <xsd:attribute name="Alias" type="ST_ObjectName" wbld:cname="Alias" use="optional"/>
   <xsd:attribute name="All" type="xsd:boolean" default="false" wbld:cname="All" use="optional"/>
 </xsd:complexType>

See section 5.1 for the full W3C XML Schema ([XMLSCHEMA1/2] section 2.1).