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

<link> XML tag

The <link> tag defines a link between data sources in the data model. The <link> tag must be nested within the <data> tag. Data sources are linked by columns. Hence each column link requires parent and child column attributes and a condition attribute that relates the columns. In order to join two tables or views, the foreign key columns must have a column alias in the SELECT statements. (These aliases are used to reference the parent and child column in the column link specification.)

Syntax

<link 
  parentGroup="parent_group_name"
  parentColumn="parent_column_name" 
  childQuery="child_query_name"
  childColumn="child_column_name" 
  condition="eq | lt | lteq | neq | gt | gteq | 
    like | notLike"
  sqlClause="startWith | having | where"
  name="link_name"
  > 
</link>

Parameters /Options

Description

parent_group_name

Is the name of the parent group that you want to relate to the child query.

Required for group links, but optional for column links.

parent_column_name

Is the name of a column in the parent query that relates to a column in the child query (that is, child column).

Required for column links, but optional for group links

child_query_name

Is the name of the child query that relates to the parent group.

Required for group links, but optional for column links

child_column_name

Is the name of a column in the child query that relates to a column in the parent query (that is, parent column).

Required for column links, but ignored for group links

condition

Is a SQL operator that defines the relationship between parent column and child column. Valid values are:

  • eq (equal to)
  • lt (less than)
  • lteq (less than or equal to)
  • neq (not equal to)
  • gt (greater than)
  • gteq (greater than or equal to)
  • like (the condition is true when the value in one column matches the pattern in the other column. The pattern can contain % and _ as wildcard characters.)
  • notLike (the condition is true when the value in one column does not match the pattern in the other column. The pattern can contain % and _ as wildcard characters.)

sqlClause

Is the type of SQL clause that relates the parent group to the child query. The default is a WHERE clause.

link_name

Is a name for the link.

Examples

The following example shows the data model segment of a report definition with a link between two queries:

<data>
  <dataSource name="Q_dept">
    <select>
      select deptno deptno_dept from dept
    </select>
  </dataSource>
  <dataSource name="Q_emp"> 
    <select>
      select deptno deptno_emp, ename, empno, sal from emp
    </select>
  </dataSource>
  <link parentColumn="deptno_dept" 
    childColumn="deptno_emp" 
    condition="eq" sqlClause="where"/>
</data>

See also

About XML in reports

Oracle Reports XML tags