<select>
XML tagThe <select>
tag delimits
the beginning and ending of a SELECT statement within the data model. The <select>
tag must be nested within the <dataSource>
tag.
<select>
content_of_SELECT
</select>
The following example shows the data source 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>
A user parameter is automatically generated for you if you include it as a bind reference in a SELECT statement. For example:
<select>
select * from dept where deptno > :p_dept;
</select>
This SELECT statement would cause a user parameter named p_dept
to be automatically generated. Therefore, you would not need to manually create
it in the report definition.
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:
<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>
Copyright © 1984, 2005, Oracle. All rights reserved.