A script-enabled browser is required for this page to function properly.

<data source> XML tag

The <dataSource> tag delimits the beginning and ending of a query in the data model. The <dataSource> tag must be nested within the <data> tag. All of the data sources supported by OracleAS Reports Services (SQL and Express) are supported by this tag.

Syntax

<dataSource>
  content_of_data_source
</dataSource>

Examples

The following example shows the data model segment of an XML report definition:

<data>
  <dataSource name="q_category">
    <select>
      SELECT ic.category,
      SUM (h.sales),
      AVG (h.high_365),
      AVG (h.low_365),
      AVG (h.div),
      AVG (h.p_e)
      FROM stock_history h, indcat ic
      WHERE h.symbol=ic.symbol
      GROUP BY ic.category
    </select>
  </dataSource>
</data>

The following example shows a segment of an XML report definition that uses the <![CDATA[]]> tag to protect a SQL statement that contains a greater than sign:

<data>
  <dataSource name="Q_1">
    <select>
      <![CDATA[
        SELECT ALL VIDEO_CATEGORY_BY_QTR.QUARTER, 
        VIDEO_CATEGORY_BY_QTR.TOTAL_PROFIT
        FROM SCOTT.VIDEO_CATEGORY_BY_QTR
        WHERE (VIDEO_CATEGORY_BY_QTR.SALES_REGION='West'
        AND VIDEO_CATEGORY_BY_QTR.TOTAL_PROFIT>2000) 
      ]]>
    </select>
  </dataSource>
</data>

See also

About XML in reports

Oracle Reports XML tags