About non-linkable queries About links versus groups

Advanced Concepts 2-21 In the Validation Trigger for GROUP_BY_COLUMN, you call the following PLSQL procedure and pass it the value of GROUP_BY_COLUMN: procedure conv_param in_var IN char is begin if upperin_var in DEPTNO,EMPNO,HIREDATE then :break_col := to_char||in_var|| ; else :break_col := in_var; end if; end; This PLSQL ensures that, if necessary, a TO_CHAR is placed around the break column the user chooses. Notice how in SQL, you make a lexical reference to BREAK_COL. In PLSQL, you must make a bind reference to BREAK_COL because lexical references are not allowed in PLSQL.

2.3.4.3 Differences between bind and lexical references

Bind references are used to replace a single value in SQL or PLSQL. Specifically, bind references may be used to replace expressions in SELECT, WHERE, GROUP BY, ORDER BY, HAVING, CONNECT BY, and START WITH clauses of queries. Bind references may not be referenced in the FROM clause. An example is: SELECT ORDID,TOTAL FROM ORD WHERE CUSTID = :CUST Lexical references are placeholders for text that you embed in a SELECT statement, when you want the parameter to substitute multiple values at runtime. You can use lexical references to replace the clauses appearing after SELECT, FROM, WHERE, GROUP BY, ORDER BY, HAVING, CONNECT BY, and START WITH. You cannot make lexical references in PLSQL. Before you reference a lexical parameter for a column or table, you must have predefined the parameter and given it an initial value. An example is: SELECT ORDID, TOTAL FROM ATABLE

2.3.5 About non-linkable queries

A non-linkable query is a detail query that contains column objects that prevent the query from being linked to through a column-to-column link when you create a column-to-column link, Oracle Reports Builder adds a WHERE clause to your query. If you attempt to create such a link, a message dialog box displays, which prompts you to choose whether to create a group-to-group query using the parent groups, or to cancel the operation. A non-linkable query displays the non-linkable query icon in its title bar. Instead, you can create a group-to-group link when you create a group-to-group link, Oracle Reports Builder does not add a WHERE clause to your query between the two queries and add a WHERE clause to the child querys SELECT statement, using a bind variable to reference the parent column. See Section 4.8.9, Creating a data link . For example, suppose you want to create a column-to-column link between the ADDRESS.STREET column in your child query and the LOC1 column in your parent query. You can create a group-to-group link, and then modify the child query SQL statement to say: SELECT FROM EMP E WHERE E.ADDRESS.STREET = :LOC1 2-22 Oracle Reports Users Guide to Building Reports See also Section 1.7.4, About data links Section 1.7.1, About queries Section 2.3.4.1, About bind references

2.3.6 About links versus groups

In Oracle Reports Builder, data is defined independent of format layout. Therefore, you should be aware of when to use data links instead of groups. The layouts of a masterdetail report that uses two queries and a data link, and a group report that uses one query and two groups can be identical. Following is an example of a default masterdetail report and a group report that query the same data. Notice the difference between the two reports: unlike the group report, the masterdetail report displays department 40. This is because the data link in the masterdetail report causes an outer-join: the link automatically fetches unrelated data. If you are designing a group report that requires an outer-join, explicitly add it to your SELECT statement with +. Figure 2–3 Default masterdetail and group report that query same data A masterdetaildetail report, as shown in the figure below, is a report that contains three groups of data: for each master group, two unrelated detail groups are displayed. To produce a masterdetaildetail report or any variation of it, you must use data links. If you try to produce this report with a control break using a single Advanced Concepts 2-23 query and three groups the query will establish a relationship between the two detail groups. Figure 2–4 Masterdetaildetail report See also Section 1.7.2, About groups Section 1.7.4, About data links

2.3.7 About matrix objects