Escolar Documentos
Profissional Documentos
Cultura Documentos
1 of 4
http://learnoracleeasy.blogspot.in/2013/06/oracle-reports-material-part...
v Graph : Displays the Graph Wizard so that you can to define a graph that will
be inserted into your layout.
v Field : -Creates a field object.
v Anchor : -Creates an anchor between two objects in your layout.
v File Link: Creates a link file object that you can use to link an external file to
your report.
v Report Block: Displays the Report Block wizard so that you can add a new report
block to your layout.
v Query
A SQL SELECT statement that specifies the data you wish to retrieve
from one or more tables or views of a database.
v RDF file
A file that contains a single report definition in binary format. .REP files
are used solely to run reports; you cannot edit a .REP file.
v Template
The objects are similar to layout objects. The source of a parameter field comes
from a parameter that is a Data Model object. Parameters appear in the Object
Navigator, not in the Data Model view.
v About parameters
21-12-2015 17:47
2 of 4
http://learnoracleeasy.blogspot.in/2013/06/oracle-reports-material-part...
PRINTJOB
DECIMAL
THOUSANDS
DESFORMAT
ORIENTATION
DESNAME
DESTYPE
User parameters
A user parameter is a Data Model object that you create to hold a value that users
can change at run time.
You can create your own parameters and use them to change the SELECT statement
of your query at run time.
user parameters are two types.
1) Bind parameter/reference
2) Lexical parameter/reference
v You can reference a parameter anywhere in a query. For example:
Restrict values in the WHERE clause of the SELECT statement
Substitute any part of the SELECT statement, including the entire
statement
Substitute a single column or expression in the SELECT list.
Difference between system and user parameter: -
1. In the Obj. Nav choose the User Parameter node, and then choose the Create tool.
Note: If this is the first parameter, you can create it by double-clicking the User
Parameter node.
Bind references (or bind variables) are used to replace a single value or expression in
SQL or PL/SQL, such as a character string, number, or date.
To create a bind reference in a query, prefix the parameter or column name with colon
(:).
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.
Restrictions:-
Bind references must not be the same name as any reserved SQL keywords.
Bind references may not be referenced in FROM clauses or in place of reserved words
or clauses.
Replace any part of a FROM clause.
Replace a column name in the SELECT clause, although you can reference a
value, such as the contents of a parameter:
SELECT LAST_NAME, SALARY * :P_RATE FROM S_EMP.
Example 1: SELECT clause
v SELECT CUSTID, NVL(COMMPLAN, :DFLTCOMM) COMMPLAN FROM
ORD;
Example 2: WHERE clause
v SELECT ORDID, TOTALFROM ORD WHERE CUSTID = :CUST;
Example 3: GROUP BY clause
v SELECT NVL(COMMPLAN, :DFLTCOMM) COMMPLAN, SUM(TOTAL)
TOTAL
FROM ORD GROUP BY NVL(COMMPLAN, :DFLTCOMM);
Example 4: HAVING clause
21-12-2015 17:47
3 of 4
http://learnoracleeasy.blogspot.in/2013/06/oracle-reports-material-part...
TOTAL
FROM ORD GROUP BY NVL(COMMPLAN, :DFLTCOMM);
Example 4: HAVING clause
v SELECT CUSTID, SUM(TOTAL) TOTAL FROM ORD
GROUP BY CUSTID HAVING SUM(TOTAL) > :MINTOTAL;
Example 5: ORDER BY clause
v SELECT ORDID, SHIPDATE, ORDERDATE, TOTAL FROM ORD
ORDER BY DECODE(:SORT, 1, SHIPDATE, 2, ORDERDATE);
v procedure double is
begin
:my_param := :my_param*2;
end;
The value of myparam is multiplied by two and assigned to myparam.
Lexical Reference?
A lexical reference is a text string and can replace any clause of a SELECT statement,
such as column names, the FROM clause, the WHERE clause, or the ORDER BY
clause (or) even to replace the entire statement.
To create a lexical reference in a query, prefix the parameter or column name with an
ampersand (&).
If the parameter object does not exist, Report Builder automatically creates it for you
and displays a message. In this case, the parameter default datatype is
CHARACTER, not NUMBER. (This stmt is applicable for both Bind and Lexical).
Ensure that the number of values and datatypes match at run time.
About lexical references
Lexical references are placeholders for text that you embed in a SELECT stmt.
You can use these to replace the clauses appearing after SELECT, FROM, WHERE,
GROUP BY, ORDER BY, HAVING, CONNECT BY, and START WITH.
Use a lexical reference when you want the parameter to substitute multiple
values at runtime.
Restrictions
To specify both above clauses at run time (as two separate parameters):
v SELECT NAME, SALES_REP_ID
FROM S_CUSTOMER
&P_WHERE_CLAUSE
&P_ORD_CLAUSES
NOTE:
21-12-2015 17:47
4 of 4
NOTE:
http://learnoracleeasy.blogspot.in/2013/06/oracle-reports-material-part...
1) Bind parameter can hold only one parameter value at a time where as Lexical
parameter can hold more than one.
2) In Bind parameter, we can use : (colon) as prefix where as In Lexical parameter, &
(ampersand) as prefix.
3) Bind parameter accepts condition clause where as Lexical parameter accepts query
clause.
REPORTS EXECUTABLES
v .rdf : - (binary+text) Full report definition (includes source code and comments)
modifiable through Builder binary, executable.
Portable if transferred as binary (PL/SQL recompiles on open and run).
v .rep : - (binary) No source code or comments not modifiable binary, executable.
Portable as binary if no PL/SQL is present
v .rex : - (text) Full report definition not modifiable ASCII text, not executable.
100% portable.
Note :- Save the report module in File system or Database.
21-12-2015 17:47